BERKELEY — Amid catcalls and cries of “shame” from the gallery, the City Council voted Tuesday to allow police to use pepper spray in an effort to curb violent protesters, two days before conservative commentator Ben Shapiro’s scheduled speech on the UC Berkeley campus.

Police Chief Andrew Greenwood requested the authorization, arguing that officers had inadequate tools for dealing with “new weapons, new tactics and a higher level of coordination than we have seen” at clashes between conservative and far-right protesters and those who he said had “launched brutal attacks against those they have decided shouldn’t be allowed to speak.”

Greenwood called the situation urgent, with the potential for more violent clashes Thursday when Shapiro is slated to appear at 7 p.m. before a sold-out crowd at Zellerbach Hall, expected to draw 1,000 students. At least one group, Refuse Fascism, is planning to protest his appearance and has called for a 6 p.m. rally in Lower Sproul Plaza. Later this month, Milo Yiannopoulos and conservative commentator Ann Coulter have said they will appear on campus during Free Speech week, raising the specter of more violent protests.

Berkeley has become a battleground between conservatives and counter-protesters on the left. Though most of the protesters were peaceful, clashes between smaller groups have left civilians and police officers injured.

“We have seen extremists on the left and on the right in our city,” said Mayor Jesse Arreguin, who introduced the motion to amend the use-of-force policy, eliciting loud boos. “We aren’t distinguishing between ideology, we are concerned about the violence on both sides.”

Greenwood and Arreguin stressed that under the new policy, police still could not use pepper spray “to disperse a crowd or on people engaged in peaceful legal or unlawful nonviolent resistance.” That was, however, the case during a 2011 protest at UC Davis that drew widespread condemnation.

Greenwood said the use of pepper spray aerosol dispensers, which officers already carry on their belts, would allow them to employ “a direct, limited application of force to repel specific attackers. By contrast, he said, tear gas releases a chemical irritant into a larger area that can affect peaceful protesters, while using batons carries a greater risk of injury to officers and suspects.

Yet more than two dozen people spoke for two hours against the change to the department’s General Order U-2 Use of Force policy, arguing that it would escalate rather than de-escalate violence, that the pepper spray would harm people beyond those individuals targeted and that city officials had not given members of the public enough notice to attend the meeting and participate in the debate.

“Attempting to tear-gas people in a crowd could result in a serious stampede with many people getting hurt,” said J.P. Massar, a physicist at UC Berkeley, during the public comments. “We don’t know what’s going to happen. Are you willing to be responsible?”

Councilmembers Kriss Worthington, Cheryl Davila and Kate Harrison voted against the measure. Berkeley resident Christine Schwartz was among the handful of speakers who voiced support.

“I did see people out there with weapons,” she said. “I think our police are in a bad situation, and we need to give them all the tools they need.”