They asked the governor to declare a state of emergency, an action usually reserved for approaching hurricanes. They prepared to suspend bus routes and seal off roads and parking lots. They expanded mental health counseling on campus. And they offered to excuse students and employees who don’t want to go to class or work on Thursday.

When the University of Florida, under the threat of a lawsuit, agreed to allow white nationalist Richard Spencer to speak on campus, school officials didn’t wait to see what would happen.

Distilling lessons from incidents in Charlottesville and Berkeley, Calif., the UF president and political leaders from the surrounding community began taking extraordinary steps to try to ensure the Spencer speech scheduled for Thursday will be as much of a nonevent as possible.

Spencer will be corralled into a corner of the 2,000-acre campus in Gainesville, 2½ miles away from the center of the university and most of its classrooms.

Nearby buildings, including two museums and a student recreation center, will be shut down.

Access to the Phillips Center for the Performing Arts, where Spencer is slated to speak, will be limited; no vehicles or bicycles will be allowed. If people — including counterprotesters — want to get to the speech, they will have to walk a significant distance.

“Bring a good pair of walking shoes and wear sunscreen,” Alachua County Sheriff Sadie Darnell advised.

Darnell on Monday asked Florida Gov. Rick Scott (R) to declare a state of emergency in anticipation of Spencer’s speech. Scott agreed, giving local law enforcement the ability to be more “flexible” in dealing with anticipated protests and counterprotests.

Even the local jail planned to shut down: The Alachua County sheriff announced visitation and criminal registrations would be suspended Thursday and Friday.

“It’s just in case we have an influx, if things don’t go as we hope they do and people commit crimes and acts of violence,” said Sgt. Chris Sims, a spokesman for the sheriff’s office. “Should the need arise and arrests have to be made, we want to have the proper personnel and transportation at our detention facility.”

Darnell said she wants to buy more radios so the law enforcement agencies that have been called to help, from the FBI and the National Guard to the university police department, will be on the same communications system.

“We’ve had the luxury of time to prepare,” Darnell said. “The challenge is that we don’t know what we may be facing.”

University officials have tried their best to forestall violence between protesters and counterprotesters by urging students to simply ignore Spencer.

“By shunning him and his followers, we will block his attempt for further visibility,” UF President Kent Fuchs said in a statement to the university’s 52,000 students.

That didn’t stop a group of about 30 students from demonstrating in front of Fuchs’s office Monday, demanding he resign for allowing Spencer to speak on campus.

Fuchs originally denied Spencer’s request, but relented after a local civil rights attorney threatened a lawsuit.

“If you are like me, I expect you are surprised and even shocked to learn that UF is required by law to allow Mr. Spencer to speak his racist views on our campus,” Fuchs said.

UF sponsored lectures and discussions last week about the First Amendment. The flagship university created a website with answers to common questions. Fuchs and other local leaders have written letters to the local newspapers, asking for unity. Police have worked with local groups that feel vulnerable, to increase security.

“The best resolution would be if this person and this organization decided not to come, and maybe changed their message from hate to love,” said Rabbi Berl Goldman of the Lubavitch-Chabad Jewish Community Center.

Barring that, Goldman said, “We’re very in touch with law enforcement.”

The preparation is in contrast to what the University of Virginia and Charlottesville did in the run-up to Spencer’s rally in August.

Gainesville Mayor Lauren Poe said the city, UF and Alachua County law enforcement officers had conference calls with U-Va. officers to get advice. They sent five officers to California last month to observe the planned “Free Speech Week” event at the University of California at Berkeley that fizzled out before it even started.

“We learned a lot about crowd dynamics,” Poe said. “We learned about how some of these groups are looking to incite violence, how they build up to it and increase their numbers so that people that are there to peacefully protest kind of get swept up. Hopefully, we can avoid that happening.”

The interpretation of the First Amendment has been at the center of fierce debate on college campuses, football fields, Capitol Hill and cable TV. (Elyse Samuels/The Washington Post)

Poe said Gainesville and UF are also trying to preempt violence by showcasing unity and tolerance. More than a dozen religious and community leaders held a public rally Monday night in downtown Gainesville to show “a message of love.”

“We’re going to respond positively,” Poe said. “I do believe that we’re going to be an example for how a community can rise up and directly confront hatred and racism and bigotry with a positive, anti-racist message.”

If that doesn’t work, the state of emergency declaration will help. Poe said it would allow police to ban torches if necessary.

For his part, Spencer said the preparations, especially the state of emergency declaration, “are going overboard.”

He said if there’s violence, it won’t be coming from his supporters — it’s the people protesting him that police need to watch out for, Spencer said.

“We don’t want any of our people to be the one to throw the first punch,” Spencer said. “We don’t want them to do anything to harm our movement.”

Spencer said he expects anti-fascist protesters — known widely as “antifa” — will try to goad his followers.

“But we can’t stoop down to their level,” he said.

Amid preparations by authorities, so far it’s one unofficial act that has had an effect.

Paul Evans, the owner of Tall Paul’s Brewhouse and microbrewery Alligator Brewing, last week offered a free beer to anybody 21 and older who brought in two tickets to the Spencer speech. Free tickets were originally going to be distributed by the box office at the Phillips Center, which is what the contract with Spencer’s group calls for.

But when Spencer heard about the Alligator Brewing plan, he had his followers pick up the tickets, and plans to distribute them through his group on the day of the speech.

“They were going to give beer to people who turned in their tickets,” Spencer said. “People are just trying to ruin the event.”

Evans said his Facebook page for the ticket-beer exchange had 300,000 likes before Spencer took control of the tickets.

“I was just trying to make a bad situation a little better. Gainesville is a very liberal, progressive place. We were trying to ease some of the tension this has caused,” Evans said. “We were just going to offer an alternative, so the auditorium would have empty seats, and those tickets would be used for free beer instead of giving him an audience for his noise.”

The University of Virginia faced intense criticism after Spencer led a torchlight march on campus and white nationalists fought with a small group of students and other counterprotesters.

A report commissioned by the university concluded that school officials could have responded more effectively if they had gathered more information about the marchers, had a better understanding of the university’s rules for demonstrations and adapted policies to handle large groups of potentially dangerous protesters. University officials assumed the demonstration would be similar to others on campus that were expressions of free speech, the report found, not something menacing. 

Clashes turned deadly the next day in Charlottesville, when a man drove into a crowd of people protesting the planned “Unite the Right” rally, killing one woman and injuring many more.

Critics said despite planning for the event, police weren’t prepared for armed militia members and didn’t keep enough separation between white nationalists and counterprotesters; the Charlottesville police chief said in a statement at the time that there had been plans in place not visible to onlookers and that there was never a “stand down” order issued.

Colleges have long hosted controversial speakers, and protests come as no surprise. But the landscape changed this year at the University of California at Berkeley, when Milo Yiannopoulos, a writer who provokes strong reactions from people, tried to give a speech on campus in February.

It was not long after President Trump’s inauguration, and tensions were high, with protests happening around the country. More than 1,000 students and others had gathered to peacefully — if fervently — object to Yiannopoulos’s speech, when 150 black-masked antifascists and other extremists, some of them armed, arrived.

They threw rocks, smashed windows and set fires, prompting university police to cancel the speech and lock down the campus until the crowd dispersed.

Trump posted an outraged tweet about the public university stifling free speech, and Berkeley, the home of the free speech movement of the 1960s, became a symbol and a target as well as a site for academic debate.

So when student groups invited polarizing speakers to campus this year, Berkeley officials had to plan for more intense reactions than in the past and put in place extensive security efforts.

That has been enormously expensive.

This year, the school has spent well in excess of $2.5 million on security related to controversial speakers, spokesman Dan Mogulof said. Those costs included spending for conservative commentator Ann Coulter, even though she decided not to come to campus, and for conservative writer Ben Shapiro. It included security expenses related to the “Free Speech Week” that Yiannopoulos had announced — even though plans for that event fell apart, and Yiannopoulos came to campus only for a brief appearance.

It was enormously helpful to have a massive law-enforcement presence on campus, Mogulof said.

“Who knows what’s around the corner? . . . The current context does seem to suggest that it would be hard to do too much.”

After Charlottesville, several public universities announced they would not allow Spencer to speak on campus. The University of Florida was among them, citing “specific security threats.”

But his supporters and a lawyer challenged that on First Amendment grounds, saying the school could not deny him the right to speak based on expected reaction from opponents — known as the “heckler’s veto.”

This spring, a federal judge reversed Auburn University’s cancellation of a Spencer event, ruling that a decision based on the content of the speech was a violation of the First Amendment and finding no evidence that Spencer advocated violence.

One of Spencer’s supporters filed a lawsuit against Michigan State University, seeking to force the school to allow Spencer to speak on campus.

Earlier this month, the University of Florida reluctantly agreed to a later date.

When officials announced Spencer would speak on campus, they already had an estimate of what that would cost them: at least $500,000.

The delay gave them time to plan.

The contract with Spencer’s National Policy Institute includes many details. No signs without approval. No restrictions on the university’s right to cancel the event for safety reasons. And no open flames.