BERKELEY, Calif. — Several thousand people converged in Berkeley on Sunday for a “Rally Against Hate” in response to a planned right-wing protest that raised concerns of violence and triggered a massive police presence.

Several people were arrested for violating rules against covering their faces or carrying items banned by authorities.

Tense but brief skirmishes erupted when several dozen left-wing protesters surrounded and shouted at a handful of right-wing demonstrators.

Three of those targeted sought safety by rushing toward officers and were escorted out of the park. They were put in a van that was kicked by yelling left-wing protesters as it pulled away.

The left-wing protesters far outnumbered those who showed up for the largely peaceful rally, which police tried to keep safe by setting up barricades around it and checking people who entered to make sure they did not have prohibited items such as baseball bats, dogs, skateboards and scarves or bandannas they could use to cover their faces.

Anti-rally protesters chanted slogans “No Trump. No KKK. No fascist USA” and carried signs that said: “Berkeley Stands United Against Hate.”

Berkeley is the city that gave birth to the 1960s Free Speech Movement but authorities refused to issue a permit allowing Sunday’s event. The city and the University of California, Berkeley campus have been the site of political clashes and violence over the past year.

At one point Sunday, an anti-rally protester denounced a Latino man holding a “God Bless Donald Trump” sign.

“You are an immigrant,” Karla Fonseca said. “You should be ashamed of yourself.”

Several other people also yelled at the man, who said he was born in Mexico but supports President Trump’s proposal to build a wall along the southern border.

Police pulled one Trump supporter out of the park over a wall by his shirt as a crowd of about two dozen counterprotesters surrounded him and chanted “Nazi go home” and pushed him toward the edge of the park. At least two people were detained by officers for wearing bandannas covering their faces.

Earlier Sunday, a separate counterprotest took place on the nearby Berkeley university campus despite calls by university police for demonstrators to stay away. From the campus, the crowd marched to Civic Center Park and merged with the anti-rally protesters who had already gathered there.

The Berkeley rallies happened a day after a rally planned by a right-wing group fizzled amid throngs of counterprotesters in San Francisco. San Francisco Mayor Ed Lee declared victory over a group he branded as inviting hate.

The organizer of Sunday’s right-wing event was Amber Cummings, a transgender woman and Trump supporter who has repeatedly denounced racism.