SAN FRANCISCO (AP) — Police and civic leaders in the cradle of America’s free speech movement will struggle to balance liberty of expression with safeguards against violence as demonstrators with varying political viewpoints travel to the San Francisco Bay Area for dueling rallies throughout the weekend.

On Saturday, a politically conservative group called Patriot Prayer will host a “freedom rally” near the foot of the Golden Gate Bridge, over the vociferous objections of San Francisco’s Mayor Ed Lee and other Democratic leaders who say the group invites hate. On Sunday, a transsexual supporter of President Donald Trump plans a “No to Marxism in America” event in a downtown city park in nearby Berkeley.

Opponents will mobilize too, including clowns and drag queens as well as an anti-Trump organization that has sometimes supported violent tactics.

The challenge for law enforcement comes after an Aug. 12 rally of white supremacists in Charlottesville, Virginia that turned deadly, killing one counter-protester and two state troopers. Police in both California cities traditionally have given demonstrators a wide berth, even when rallies in recent years turned violent as protesters from both the left and the right have punched people, destroyed property and engaged in violence.

But the deaths and injuries in Charlottesville have police, civic leaders and civil rights groups in the San Francisco area and across the United States rethinking how to respond to hate speech and how to manage competing protests.

The American Civil Liberties Union said it will no longer represent hate groups that demonstrate with weapons after it was criticized for persuading a judge to let the Charlottesville protest go forward. In Boston last weekend, police successfully separated tens of thousands of people shouting anti-Nazi and anti-KKK slogans who showed up to protest a much smaller conservative “free speech” rally — but drawing some complaints that the speakers didn’t get to be heard.

“We’re in an interesting situation no question about it, where the Bay Area, known for its protection of speech is also known for how much it deplores discrimination and hate speech,” said Julie Nice, a constitutional law professor at the University of San Francisco School of Law.

She said police are in a tough spot because they are constitutionally obligated to protect even hateful speech until the point that speech crosses the line into violence.

In the San Francisco area, protesters this weekend will face more restrictions and beefed-up police powers than in the past. The Berkeley City Council has expanded the authority of police to confiscate eggs, sticks and other perceived weapons, a position defended by Berkeley’s mayor despite the politically liberal city’s reputation as the birthplace of the free speech movement and a bastion of tolerance.

Mayor Jesse Arreguin said this week he is tired of his city being targeted by people who show up in military wear and support positions that he calls anti-immigrant, anti-Muslim, and anti-gay.

“We have gone above and beyond to facilitate the right for all voices to be heard. What we don’t stand for is violence, what we don’t stand for is vandalism and we don’t stand for thuggery,” he said. “What we don’t tolerate is people using the concept of freedom of speech to commit violence.”

Student activism was born during the 1960s free-speech movement at Berkeley, when thousands of students at the university there mobilized to demand that the school drop its ban on political activism. More recently, the University of California at Berkeley has come under criticism for what some have characterized as suppression of unpopular views.

In February, officials at the University of California at Berkeley were forced to cancel a talk by right-wing provocateur and Trump supporter Milo Yiannopoulos after black-clad protesters hurled smoke bombs and sparked a huge bonfire.

Amber Cummings, who is organizing the rally against Marxism, said racists and hate groups are not invited to her Sunday event. But the anti-Trump group By Any Means Necessary has vowed to shut down the Berkeley rally and authorities worry the two sides could clash.

In San Francisco, the park service issued a permit for the Portland, Oregon-based Patriot Prayer gathering, but banned more than two dozen items, including guns, helmets and tiki torches. They’re also working on a plan to keep rally-goers and opponents separated at Crissy Field.

San Francisco cannot block the event because the park is on federal land. But Mayor Ed Lee has urged people to stay away.

“I ask that people avoid going to Crissy Field and engaging with members of Patriot Prayer because that is precisely what they wish us to do and I don’t want to dignify their message of hate and their mission of division in our city of love of compassion,” Lee told a Wednesday news conference.

Joey Gibson said he organized Patriot Prayer after Trump supporters were beaten in San Jose, California last summer during a campaign stop. He pushed back at Lee and other political opponents, saying that his group doesn’t harbor racist views and that hate groups aren’t welcome, although his events have attracted violence and white nationalists.

“Right now we have an issue of tolerance. It’s not just skin color or gender, I’m talking about tolerance of speech,” said Gibson, who is Japanese-American. “We believe that someone is an enemy because they think differently or they voted for someone different.”

One of the featured speakers is Kyle Chapman, a right-wing organizer who faces a charge of illegal possession of a baton he was seen swinging at counter-protesters during a chaotic rally for Trump in Berkeley earlier this year.

Officials from both Berkeley and San Francisco urged opponents to attend separate events scheduled at the same time as the politically conservative gatherings on Saturday and Sunday. A drag queen troupe has scheduled its own rally to promote “love and peace” in San Francisco’s Castro neighborhood Saturday afternoon.

Yet, there are calls by counter protesters for people to join them in force at Crissy Field to “send a message that hate has no safe space” in the city.

Nearly two dozen political protests in California have turned violent since December 2015, according to the Center for the Study of Hate and Extremism at California State University, San Bernardino.

Dealing with that violence is a “thankless job” for law enforcement, said Brian Levin, the center’s director, adding that he supports Berkeley’s new get-tough approach.

“They get criticized for cracking down,” he said, “or they get criticized for doing nothing.”

Here is a statement from San Francisco on this weekend:

San Francisco is activating the City’s Emergency Operations Center (EOC) in support of the numerous events taking place on Saturday August 26. EOC staff will support event operations, coordinate City resources, and provide public information as necessary.

And here is a statement from San Francisco General Hospital:

We are preparing for Saturday’s events just like all city agencies. In our case, we are ensuring that the city’s only trauma center at Zuckerberg San Francisco General Hospital is ready to respond if needed.

WHAT OTHERS ARE CLICKING ON:

>> MORE TOP STORIES