Berkeley police have arrested more than a dozen anti-fascist activists and posted their names and photos on Twitter, raising concerns that the department was encouraging harassment and abuse.

Law enforcement’s unusual decision to immediately publicize the personal information and faces of arrested leftwing demonstrators on social media has sparked intense backlash. Critics have accused police of aiding the far right and endangering counter-protesters with “public shaming” and targeted arrests for alleged minor offenses.

The California police agency said it had arrested 20 people on Sunday at an “alt-right” rally, citing many of them for “possession of a banned weapon” or “working with others to commit a crime”. Most, if not all, of the people arrested were counter protesters, according to lawyers and activists working with demonstrators.

The department posted many of their names, photos and cities of residence on its official Twitter account on Sunday before anyone was formally charged. As of early Monday afternoon, a spokesperson for the local district attorney told the Guardian that Berkeley police had not yet brought the cases to prosecutors for consideration.

“This is very disturbing,” said Veena Dubal, a University of California law professor and former Berkeley police review commissioner. “It seems like a public-shaming exercise, which is not the role of the police department ... They are making it really accessible for folks who might wish these people harm to locate them.”

Berkeley’s mayor, Jesse Arreguín, told the Guardian that he was not involved in the decision to publish mugshots and would not directly answer questions about whether he supported the choice. He said he planned to talk to police officials about it: “We need to look into this and discuss whether this is an appropriate practice going forward.”

The controversy comes as police agencies in California and across the country have repeatedly faced scrutiny for working with neo-Nazi and white supremacist groups by shielding leaders of those organizations and arresting and prosecuting anti-fascists participating in counter demonstrations. Events organized by Trump supporters and the far right have repeatedly devolved into violent clashes in the US, with anti-fascists accusing police of using excessive force against the left.

Stabbed at a neo-Nazi rally, called a criminal: how police targeted a black activist Read more

At the Sunday event, billed as a No to Marxism in Berkeley rally, anti-fascists outnumbered the rightwing members, some of whom wore combat boots and Army fatigues, according to the East Bay Times.

Before the rally, the city issued broad rules prohibiting “weapons” in the area and “anything … that can be used for a ‘riot’”. Officials also banned protesters from wearing masks. The enforcement of the new rules appeared to have driven many of the arrests.

“It really seemed to us like the Berkeley police department was there to … target the anti-fascist protesters,” said Jay Kim, executive director of the National Lawyers Guild’s local chapter, which is assisting those arrested. Police appeared to be taking in protesters “at random” and for arbitrary reasons, in some cases with spurious claims about weapons, she said.

A total of 21 people contacted the NLG, which confirmed the “vast majority” were anti-fascists, said Kim. Some were bailed out and others remained incarcerated. One person was arrested for bringing poles to put up a sign, according to Kim.

Some said Berkeley’s decision to post mugshots was akin to the increasingly common rightwing tactic of “doxxing” anti-fascists, meaning publishing people’s private information online as part of an intimidation effort. By Monday morning, Fox News and other major publications had posted the photos and names.

“It really indicates a complete lack of concern around people’s safety,” said Zoé Samudzi, a local activist who is helping raise money for the arrested people’s legal fees. “That’s a practice that I can’t even begin to wrap my head around … They have been really accommodating of fascists.”

The Berkeley police spokesman Byron White defended the release of the mugshots in an interview, saying, “People are coming from out of town and bringing weapons and are committed to violence … We don’t want people to be able to do that with anonymity.”

All but one of the people arrested, however, were from the Bay Area, mostly from Berkeley and the neighboring city of Oakland. Only one person whose photo was published was explicitly accused of a violent crime.

White said he could not provide a list of the alleged weapons and was unable to say what “crime” was alleged in the “working with others to commit a crime” offenses. He said some protesters had engaged in vandalism.

Although mugshots and arrest details are generally considered public information, it is rare for police to post this kind of detailed information on social media, especially before charges have even been filed, when the accusations are for minor violations and when there is no active public safety risk.

Doxxing, assault, death threats: the new dangers facing US journalists covering extremism Read more

Sam Menefee-Libey, a Washington DC activist who helped protesters prosecuted for demonstrating at Trump’s inauguration, pointed to several similar cases. St Louis police came under fire last year when the department posted the name and addresses of protesters. A rightwing news site also obtained a police list of arrested Trump protesters last year and published the names.

“It’s clear that the cops have chosen sides and that they think of the left as their enemies,” he said. “The cops are doing something that Nazis do all the time, which is dox people.”

Police generally did “a very good job” at the rally, Arreguín, the mayor, said, adding: “Overall, it was a success. People came. They protested. There was minimal violence.”

Yvette Felarca, an anti-fascist activist who has previously faced protest-related charges but was not arrested on Sunday, said police would not intimidate demonstrators from continuing to protest against the far right.

“This is a pattern we’ve seen, but it’s taken it to a different level in an attempt to discourage people from standing up,” she said. “It’s not going to stop the resistance against fascism.”