Several California professors slammed the Berkeley Police Department after it posted the mugshots of Antifa protesters arrested Sunday at a rally where windows were smashed, citizens were punched and "dozens of weapons" were confiscated by cops.

Berkeley cops said Sunday that 20 people were arrested demonstrating against a rally organized by so-called "alt-right" groups. The mugshots of those arrested, their names and what they were arrested for allegedly doing was posted to the BPD's Twitter account -- a practice that is not unusual. The mugshots were posted before the protesters were formally charged. The department told The Guardian on Monday that the protesters' cases were not brought before prosecutors.

Veena Dubal, a law professor at the University of California, said she found it “disturbing” that the police department would post the mugshots and risk the possibility of putting the demonstrators in danger.

“This is very disturbing,” Dubal told The Guardian. “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 POLICE ARREST 20, SEIZE 'DOZENS OF WEAPONS' AT OPPOSING PROTESTS

Berkeley Mayor Jesse Arreguín said the police “did a very good job” handling the rally. But he said he spoke to police about the posting of mugshots on social media.

“We need to look into this and discuss whether this is an appropriate practice going forward,” Arreguín said.

The Sunday protest began after two groups of "alt-right" protesters announced plans for a "No to Marxism" rally at the city's Civic Center Park earlier in the week. That prompted plans for a "Sweep Out The Fascists" march and counter-rally that drew hundreds of people downtown.

Officials said three people suffered minor injuries after a group of "extremists" threw "explosives" -- believed to be fireworks and flares -- at police and Alameda County Sheriff's officers. No members of law enforcement were hurt.

Berkeley police also said that "an extremist element among a large group" damaged 21 city vehicles, setting one on fire, and slashed their tires. The group also set fires in trash bins, which were extinguished quickly.

Videos taken during the protest also showed masked Antifa protesters smashing the windows of a U.S. Marine Corps recruiting office and another demonstrator sucker-punching someone.

But Jay Kim, the executive director of the National Lawyers Guild local chapter, said he felt police were targeting “anti-fascist protesters.”

“It really seemed to us like the Berkeley police department was there to…target the anti-fascist protesters,” Kim said.

Kim said about 21 people contacted the NLG regarding the arrests, claiming the “vast majority” arrested were anti-fascist protesters.

Byron White, a spokesman for the Berkeley Police Department, defended the release of the mugshots.

“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,” White said.

Fox News’ Robert Gearty contributed to this report.