(CNN) In September, Milo Yiannopoulos strolled onto the University of California’s Berkeley campus, surrounded by supporters, hecklers and a lot of police.

Wearing an American flag hoodie, the right-wing commentator took selfies, signed autographs and posed with signs, including one that read: “Feminism is Cancer.”

His 15-minute appearance cost UC Berkeley $800,000 in what the school’s spokesman Dan Mogulof called “the most expensive photo-op in the university’s history.”

Free speech has neither come free nor cheap on campuses this year — especially amid fierce protests in response to controversial speakers.

On Tuesday, Yiannopoulos is scheduled to speak at California State University, Fullerton as part of his “Troll Academy” tour. He was invited there by the Cal State Fullerton College Republicans.

The university is closing several campus roads, shutting its student union early and increasing police presence on campus for the event. Attendees will have to go through metal detectors and won’t be able to bring backpacks, Halloween masks or any weapons.

So far, the school won’t discuss the costs involved in the event.

“We are refraining from discussing projected costs or details of our safety planning as to not diminish the effectiveness of the efforts underway,” Jeffrey D. Cook, the university’s chief communications officer, wrote in an email.

If past events are any indicator, Tuesday’s event could be a costly one for the southern California university.

Earlier this month, the University of Florida spent more than half a million dollars in security costs for a speech by white supremacist Richard Spencer.

In April, UC Berkeley spent $600,000 in security for Ann Coulter’s canceled event. The university has already spent more than $2 million on managing protests since July, the beginning of its fiscal year.

“We are in a period of tumult on campus when controversial speakers and protests in response are racking up huge security bills,” said Suzanne Nossel, executive director of PEN America, a free expression organization.

Schools’ dilemma: Safety and speech

Public universities can’t dictate which speakers students groups can invite to campus. They have to allow speakers regardless of viewpoints — even when they know the speaker is likely to draw protests.

“Once a speaker has been invited by a student group, the campus is obligated and committed to acting reasonably to ensure that the speaker is able to safely and effectively address their audience, free from violence or disruption,” according to Cal State Fullerton’s Free Speech website.

Schools are responsible for security — even in cases when the speaker isn’t invited by any student group.

Spencer hadn’t been invited to the University of Florida campus by any student group. He and the National Policy Institute rented the speaking space there. The school couldn’t deny him based on the content of his speech or viewpoints.

Ahead of his visit, Florida Gov. Rick Scott declared a state of emergency for the county where the event was happening. Although Spencer’s event was not affiliated with the school, the University of Florida provided security — at a cost of more than $600,000.

“I really don’t believe that’s fair that the taxpayer is now subsidizing through these kind of events the security and having to subsidize his hate speech,” university President W. Kent Fuchs said earlier this month.

Texas A&M University changed its policy on the use of its campus facilities following Spencer’s invite to the school by a private citizen who rented out the space for a December event.

Berkeley’s security expenses skyrocket

Costs are soaring for UC Berkeley, which has a storied history of campus and political activism.

In February, violence erupted before a speech by Yiannopoulos. At least six people were injured and protesters caused $100,000 worth of damage to the university when they threw fireworks, rocks and Molotov cocktails. Yiannopoulos had been invited to speak by the Berkeley College Republicans.

Berkeley has since been trying to prevent the kind of violence seen that night.

Three months into its new budget year, Berkeley’s security expenses have spiraled into the millions — a stark contrast to 2015 and 2016 when it spent less than $200,000 annually, Mogulof said.

In September, the university spent more than $600,000 in security costs for a speech by Ben Shapiro, the editor of the conservative The Daily Wire, after he was invited by the Berkeley College Republicans.

Universities bear the expense for security, such as police reinforcements from other departments, as well as those officers’ room and board.

“If and when the situation demands in the future, we spend that kind of money… it’s something we have to do,” Berkeley’s Mogulof said.

UC Berkeley Chancellor Carol Christ recently announced a new commission, comprised of students, staff and faculty, to examine policies around such events, including security, free speech and legal obligations.

The University of California also announced last week it would establish a new National Center for Free Speech and Civic Engagement in Washington, which would examine and research the state of free speech on campus.

Safety and speech

Universities are trying to balance safety and speech.

“These two things are core values,” said Peter McDonough, vice president and general counsel of American Council on Education. “The cost that we’re talking about, sort of is a corollary to the intensity of desire to make both these things happen. [Universities] have to figure out before the event happens, ‘What’s the likelihood of people not being kept safe?'”

Spencer’s appearances on college campuses sparked protests at Texas A&M in December and Alabama’s Auburn University in April. While the demonstrations at Auburn were largely peaceful, security measures and extra staff had been put in place in case of any violence.

One person was shot and wounded during violent protests when Yiannopoulos spoke at the University of Washington in January, reported the Seattle Times. That event cost more than $75,000 in police overtime, according to the newspaper.

“These security costs are not driven by a certain speaker or set of speakers on their own,” Mogulof said. “They’re also driven by the reaction of others to those speakers.”

Wherever controversial speakers go, their supporters and critics follow, creating a volatile and potentially violent scene.

“Over time, the hope is that student audiences will grow weary of the tactics of provocateur, that cool heads will prevail and that we can return to civilized dialogue across political and ideological divides, without fear that protests will turn violent,” said Nossel.

Universities are recognizing that the best strategy is to let controversial speech go forward, Nossel added.

She noted that some provocateurs demand forums on campus in hopes that universities will deny them.

“Some of them are begging to be shut down,” she said. By having the speech go on, it’s “depriving these ‎instigators of the opportunity to grandstand on the basis that their viewpoints are being excluded.”

But in the meantime, universities are stuck with the security bill.