Politically charged rallies and protests in Berkeley this year have cost East Bay police departments more than $1.5 million to keep the peace, according to law enforcement data reviewed by The Chronicle.

The expenses will climb as UC Berkeley girds itself for a talk Thursday by conservative commentator Ben Shapiro, a Free Speech Week at the end of the month that is expected to feature author Milo Yiannopoulos, and protests that the events may draw. Outside campus, another right-wing gathering is planned for a downtown park Sept. 24.

The Chronicle reviewed expense data connected to the rallies, protests or demonstrations that have occurred in Berkeley this year. There were five:

• Feb. 1: A fiery protest at UC Berkeley prompted campus police to cancel a scheduled speech by Yiannopoulos. Protesters included black-clad anarchists and others who objected to Yiannopoulos as a promoter of a white nationalist-linked movement and for his ties to Steve Bannon, then a senior adviser to President Trump. They smashed windows, started fires and threw bricks and fireworks as they infiltrated the building where he was to speak. One person was arrested.

• March 4: Ten people were arrested and several were wounded after bloody fistfights broke out between supporters and opponents of President Trump. The violence unfolded in Martin Luther King Jr. Civic Center Park, where a rally was organized by Trump supporters.

• April 15: A pro-Trump rally turned violent when supporters and opponents of the president again fought at Civic Center Park. Twenty people were arrested and 11 were injured.

• April 27: Conservative commentator Ann Coulter’s expected appearance at UC Berkeley prompted dozens of her and President Trump’s supporters, many in makeshift suits of armor, to gather at Civic Center Park. About 100 counterprotesters showed up, but there was no fighting — and there were no black-clad anarchists, either.

• Aug. 27: Thousands marched through downtown to protest what was billed as a right-wing “No to Marxism in Berkeley” rally. A crowd of self-style antifascists chased the rally-goers away, sometimes with beatings, from Civic Center Park. Berkeley police requested help from agencies across the East Bay. Seven people, including a police officer, were injured and 13 people were arrested.

Seven police departments and the Alameda County Sheriff’s Office provided data to The Chronicle about their expenses related to the events. The police departments were from UC Berkeley, Berkeley, Oakland, Hayward, Newark, San Leandro and Union City. Four agencies that also dispatched officers did not provide requested data: the California Highway Patrol and Emeryville, Alameda and Fremont police.

A review of data showed that the April 27 event — which saw the least violence — cost the most. UC Berkeley shelled out nearly $700,000 for expenses including the assistance of East Bay police departments as well as the lodging, meals and equipment of officers from other UC campuses, including Irvine, Los Angeles, Riverside and Santa Barbara.

The review also found that the bulk of spending went to overtime pay. Other costs included equipment, paramedics, building repair and public works installments such as fences.

Lt. Paul Liskey, emergency manager for the Sheriff’s Office, said the Berkeley protests have been unpredictable and costly, but the expenses are impossible to mitigate.

“It’s volatile. It’s mobile,” said Liskey, who coordinates mutual aid, or interagency law enforcement agreements, for the region. “Traditionally, you’d have a protest, they’d make a statement, the peaceful people would go home and the troublemakers would stay and cause destruction. Now, these two groups show up to fight each other, and we’re like the referees. It’s very hard to control that situation. It’s a crazy phenomenon.”

Because each police department absorbs the costs of crime-fighting in other cities — unlike firefighting across jurisdictions, the expenses for which the state reimburses — the protests have made a “huge difference on everyone’s budget,” Liskey said.

Liskey said that while “we’ll never say no” because “lives are on the line,” there are few incentives for cities to send their police officers to help Berkeley. On top of paying for overtime, the agencies become exposed to the possibility of equipment destruction or lawsuits stemming from use of force, he said.

When it comes to budgeting, though, the demonstrations on the UC Berkeley campus have proved to be an exception.

Since mutual aid is an emergency mechanism triggered when the resources of more than half a police department are exhausted, there can be a significant lag time before backup officers arrive, said Sgt. Sabrina Reich, spokeswoman for the campus police department. In the wake of the Feb. 1 violence outside the building where Yiannopoulos was supposed to speak, the campus began hammering out contracts with other police agencies ahead of time.

That’s why the university police ran up the big bill on April 27.

The nonevent that day cost the campus roughly $415,000 in outside law enforcement — though invoicing hasn’t been completed — plus $70,000 for other UC campus police and $96,000 for their equipment and lodging. Private security cost $4,000, and UC Berkeley’s own police required $65,000 in overtime. Building cleanup, staff overtime and paramedics’ services cost another $14,800.

Matthai Chakko, a spokesman for the city, said the protests have made an impact on the city’s budget, but how allocations will be adjusted is not yet clear.

“It’s a significant cost,” he said. “This is money that could be spent on things residents really want. We’d rather not be going through this, but we have a duty to protect people.”

In a letter to the UC Berkeley campus, Provost Paul Alivisatos said there will again be an “increased and highly visible police presence” Thursday during Shapiro’s talk. Six campus buildings will be closed so that police can establish a perimeter around the hall where he is set to speak, Alivisatos said.

Campus and police officials declined to discuss preparations or costs associated with future events, citing security threats.

Ed Obayashi, a Plumas County deputy sheriff and lawyer who has trained Alameda County law enforcement on the use of force, said that deploying large numbers of police officers is as much about psychology as it is practical public safety.

“When protesters see a show of overwhelming force — a sea of blue or green or black, especially in military gear — there’s a certain deterrent factor. It means, ‘We mean business,’” Obayashi said. “Psychologically, canines are a huge deterrent, too. The mere presence of a canine is worth about a dozen officers. No one wants to get bit by a German shepherd.”

The purpose of a big law enforcement presence — and the costs associated with it — is about preparing for the worst possibilities, Liskey said.

“We are just one incident away from having a catastrophic event,” he said. “Whether it’s a vehicle into a crowd, whether it’s a shooting, we’re at that threshold where if this goes bad, it’ll go really bad. And you can’t prevent it, but you can react to it and react quickly with force.”

Kimberly Veklerov is a San Francisco Chronicle staff writer. Email: kveklerov@sfchronicle.com Twitter: @kveklerov