FILE - In this Wednesday, Feb. 1, 2017, file photo, a bonfire set by demonstrators protesting a scheduled speaking appearance by Breitbart News editor Milo Yiannopoulos, burns on Sproul Plaza on the University of California at Berkeley campus on in Berkeley, Calif. Trump supporters and left-wing protesters have taken to the streets repeatedly in recent months in supposed free-speech demonstrations accompanied by escalating violence. But even on the so-called "Left Coast," officials in famously liberal cities such as Portland and Berkeley are growing tired of the repeated violence. (AP Photo/Ben Margot, File)

FILE - In this Monday, Feb. 20, 2017 file photo protesters clash with police, in Portland, Ore. Trump supporters and left-wing protesters have taken to the streets repeatedly in recent months in supposed free-speech demonstrations accompanied by escalating violence. But even on the so-called "Left Coast," officials in famously liberal cities such as Portland and Berkeley are growing tired of the repeated violence. (Dave Killen/The Oregonian via AP, File)

FILE - In this Sunday, Aug. 27, 2017, file photo, demonstrator Joey Gibson, right, is hit with pepper spray during a free speech rally, in Berkeley, Calif. Police in the city of Berkeley can use pepper spray on violent demonstrators after the City Council voted Tuesday, Sept. 12, to allow police to use pepper spray to repel attacks on officers and others during the kind of violent protests that have rocked the city this year. (AP Photo/Marcio Jose Sanchez, File)

FILE - In this Sunday, Aug. 27, 2017, file photo, a demonstrator lies on the ground as he is handcuffed during a free speech rally, in Berkeley, Calif. Police in the city of Berkeley can use pepper spray on violent demonstrators after the City Council voted Tuesday, Sept. 12, to allow police to use pepper spray to repel attacks on officers and others during the kind of violent protests that have rocked the city this year. (AP Photo/Marcio Jose Sanchez, File)

Dozens of people line up to tell the City Council what they think of the police request to use pepper spray on violent crowds Tuesday, Sept. 12, 2017, in Berkeley, Calif. Most residents opposed the request. Police in Berkeley sought an additional weapon Tuesday to combat violent protests that have repeatedly hit the city, asking the City Council to arm officers with large canisters of pepper spray. (AP Photo/Paul Elias)

FILE - In this Aug. 27, 2017 file photo, demonstrators clash during a free speech rally in Berkeley, Calif. Police in Berkeley, California say they need an additional weapon to combat violent protests that have repeatedly hit the city. The city council will decide Tuesday, Sept. 12, 2017, whether to let officers use pepper spray to control crowds that turn violent. (AP Photo/Josh Edelson, File)

FILE - In this April 15, 2017 file photo, pepper spray is used as anti and pro-Donald Trump protesters clash during competing demonstrations at Martin Luther King Jr. Civic Center Park in Berkeley, Calif. Police in Berkeley, California say they need an additional weapon to combat violent protests that have repeatedly hit the city. The city council will decide Tuesday, Sept. 12, whether to let officers use pepper spray to control crowds that turn violent. (Anda Chu/San Jose Mercury News via AP, File)

BERKELEY, Calif. (AP) — The University of California, Berkeley will seal off large parts of its campus like a fortress with a closed perimeter and a "very large" visible police presence Thursday, when the birthplace of America's free speech movement faces its next potential clashes.

City and campus authorities anticipate demonstrations at a speech by conservative commentator Ben Shapiro, a former Breitbart editor, and are preparing for possible violence with a variety of new strategies and tightened security.

For the first time in two decades, officers will be armed with pepper spray after the city council modified a 1997 ban at an emergency meeting this week.

The tactics to boost security are the latest indication of growing frustrations in Berkeley and other liberal cities that have become targets of violent political protests since the election of President Donald Trump and battlegrounds for extremist groups that support and oppose him.

"We have seen extremists on the left and right in our city," said Berkeley Mayor Jesse Arreguin, a Democrat who backed the police request to use pepper spray. "We need to make sure violence is not allowed."

Shapiro's event, organized by campus Republicans, is being watched as a warm-up act for later this month when provocative, right-wing speaker Milo Yiannopoulos says he plans to hold a "Free Speech Week" on Berkeley's campus with a 20-person lineup that includes Ann Coulter and Stephen Bannon, Trump's ex-chief strategist and head of Breitbart News. Campus officials say the event is not yet confirmed.

It will be Yiannopoulos' second attempt to speak at Berkeley this year, after an event in February was abruptly canceled when masked, hooded left-wing anarchists dressed in black rioted outside the event — setting fires and smashing windows on campus and on nearby city streets.

Police and UC Berkeley officials were criticized at the time for giving demonstrators wide latitude and standing aside as the masked anarchists hurled Molotov cocktails at officers and caused $100,000 worth of damage.

Violence escalated at subsequent off-campus protests and authorities say they have learned hard lessons as they struggle to balance free speech rights with preventing violence.

UC Berkeley's Provost Paul Alivisatos sent a recent campus-wide message detailing security plans, saying no one wearing masks or carrying weapons of any sort will be allowed on campus.

Police will block off the building where Shapiro is scheduled to speak and several other buildings hours before the event starts. Anyone entering the secure zone to pick up tickets must present a photo I.D. Nearby parking lots will be closed.

Berkeley police chief Andrew Greenwood said police will make "very strong, rapid arrests" Thursday night if any protesters have weapons or wear masks.

The security measures include closing Sproul Plaza, the campus' central hub that was the epicenter of the 1960s Free Speech Movement and site of its most historic protests, sit-ins and speeches.

"Things have changed," UC Berkeley spokesman Dan Mogulof said. "We're a quantum leap away from the sort of arrangements we needed to make in the past for events that have the potential to attract strong political support or opposition."

In contrast, a similar event featuring Ben Shapiro on campus in 2016 before President Donald Trump was elected and also hosted by Berkeley College Republicans had " basic security." It went off peacefully and made no major headlines.

For Thursday's event, Mogulof said authorities are deploying "very, very large numbers of police officers" from campus, city and regional law enforcement agencies.

Berkeley's frustrations are shared by officials in other famously liberal cities such as Seattle and Portland, Oregon where Trump supporters and left-wing protesters have repeatedly taken to the streets in supposed free speech demonstrations that have resulted in violence.

At a protest last week in Portland, police said anti-fascist protesters threw smoke devices and other projectiles at officers trying to keep the peace between pro- and anti-Trump crowds. Seven people were arrested.

Black-clad protesters have been a menacing presence at protests in the Pacific Northwest since before Trump was elected, often clashing with police at May Day marches, and they continue to show up at the many demonstrations.

Portland Police Sgt. Chris Burley said the frequent clashes take a toll on officers trying to protect free speech rights.

"You're out trying to ensure that everybody is able to speak their mind and observe an assault," Burley said. "As officers try to step in to stop those assaults, the crowd turns on the officers."

Greenwood, the Berkeley city police chief, sought permission for police to use pepper spray because he said it is preferable to batons and tear gas for crowd control. Tear gas when fired disperses much more widely than pepper spray, raising the risk of hurting peaceful protesters who may be near violent demonstrators, Greenwood said.

"It is a request made of urgency," Greenwood told city councilors, calling protecting protesters and police amid continued violence in the city "a unique problem."

He added: "The scope and scale of these demonstrations in our community is unprecedented."