Berkeley Police now have permission to use pepper spray to repel demonstrators attacking officers and others during violent protests of the kind that have repeatedly hit the city this year.

The City Council voted the extra safety measure on Tuesday ahead of another planned speech Thursday at the University of California, Berkeley.

Officers were preparing for violence as soon as Thursday when conservative political commentator and former Breitbart editor Ben Shapiro appears on campus and again later this month when conservative figures have been invited to speak.

The city banned pepper spray in 1997 as a crowd-control weapon, though most law enforcement agencies permit officers to use it to disburse violent crowds, Berkeley police Chief Andrew Greenwood said.

Demonstrators clash during a free speech rally in Berkeley in August, as police in Berkeley, California say they need an additional weapon to combat violent protests that have hit the city

Riot police form a blockade during a rightwing No To Marxism rally on August 27, 2017 at Martin Luther King Jr. Park in Berkeley

Police officers in DC dispense pepper spray after a limousine was set aflame after the inauguration of Donald Trump as the 45th President

Later this month, a conservative group says it plans to bring former White House adviser Steve Bannon to speak at the University of California campus along with former Breitbart editor Milo Yiannopoulos and politically conservative commentator Ann Coulter.

A Yiannopoulos appearance on campus in February was canceled for safety reasons when protests turned violent and spilled into downtown Berkeley. Protesters smashed windows of businesses and marred walls with graffiti.

Greenwood sought the permission during the emergency council meeting, saying it is preferable to batons and tear gas, which the city is allowed to use but disburses far wider than pepper spray.

The council rejected its use for crowd control Tuesday, but agreed to modify its ban and expand police powers to use it.

The council said pepper spray 'shall not be used as a crowd control technique to disperse a crowd or move a crowd,' the motion stated. 'Police may use pepper spray upon specific individuals within a crowd who are committing acts of violence upon police or others.'

Berkeley police carry small canister of pepper spray for use on individual suspects. But the police chief said officers need permission to use bigger canisters if necessary.

'It is a request made of urgency,' Greenwood said.

Both former White House Chief strategist Steve Bannon and conservative political commentator Ann Coulter have been invited to speak at the University later this month

Riot police bring out tear gas guns during a rightwing No To Marxism rally on August 27, 2017 at Martin Luther King Jr. Park in Berkeley

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

Dozens of people lined up at City Hall to oppose arming Berkeley police with the larger canister of pepper spray, saying it is too easy for officers to use and has the potential to be used on peaceful protesters.

Some cities nationwide banned pepper spray after several high-profile incidents of police using it on peaceful protesters. An incident in which students at the University of California, Davis, were pepper-sprayed during a peaceful demonstration in 2014 led to a $1 million legal settlement for the protesters.

Ishmael Tarikh, a civil rights lawyer with the National Lawyers Guild, said police must issue a dispersal order before firing tear gas canisters. Tarikh said police don't have to issue a warning when using pepper spray.

'It's a blunt instrument used for a very precise problem,' he said.

Four political demonstrations have turned violent in Berkeley since February, prompting officers to come up with new strategies to control rowdy and sometimes dangerous crowds.

Berkeley police said they have not deployed tear gas at the other protests.

Police say they are struggling to balance free speech rights with preventing violence. Berkeley is facing a 'large, armed, coordinated group' at political events, Greenwood said.

'Our officers do not have the tools to address this threat,' he said.

Joseph Giacalone, a professor at John Jay College of Criminal Justice and a former New York City police sergeant, said it would be advantageous for police to be able to use pepper spray during protests but tactical decisions should be made based on the conditions.

He said although tear gas and pepper spray often cause the same effects, shooting tear gas at a group of protesters often means spraying innocent bystanders and people frequently throw the cans back at officers.

'There are going to be bystanders in that crowd, and let's face it, the people you're trying to control come prepared for it. They have gas masks on,' Giacalone said.