Image copyright Getty Images and BBC News

A California professor posted offensive messages about a former First Lady. The resulting furore became one in a long list of flash points in the war over free speech on America's university campuses. But what happened next?

It started with a middle-of-the-night tweet.

"For a treat, I'd taken myself to a small sea village about 40 minutes away from Tunis," recalls Randa Jarrar. "It was two in the morning or something my time. I had no idea how long it had been since she passed."

Ms Jarrar, an accomplished writer and professor at Fresno State University, was in Tunisia for a book festival. As for who had passed on that day in April 2018, "she" was Barbara Bush - wife to one US president, mother to another.

When prominent people die, there's a standard response. Social media users usually offer prayers and "rest in peace" messages. But Ms Jarrar did not follow that script. She recalled controversial comments that the former First Lady had made in the aftermath of Hurricane Katrina in 2005. Thousands of New Orleans residents were displaced to other states, and Barbara Bush met some who were being sheltered in the Houston Astrodome.

"What I'm hearing, which is sort of scary, is they all want to stay in Texas," she told a radio station. "So many of the people here were underprivileged anyway, so this is working very well for them."

Most of the displaced people were poor and African-American. Years later, as Ms Jarrar scrolled through endless tributes, those comments by Mrs Bush - which were widely criticised at the time - loomed large in her mind. And she started tweeting:

Image copyright @randajarrar

She also wrote, in reference to the Iraq War: "I'm happy the witch is dead. Can't wait for the rest of her family to fall to their demise the way 1.5 million Iraqis have. Byyyeeeeeee."

At that point she had fewer than 5,000 followers and, she says, she thought she was essentially talking to a handful of feminist accounts. It quickly became clear she was not.

Conservatives on Twitter demanded she be fired. A petition calling for her "immediate termination" accumulated more than 90,000 signatures. Fox News ran a piece calling for her dismissal.

"I work as a tenured professor. I make 100k a year doing that. I will never be fired. I will always have people wanting to hear what I say," Ms Jarrar told her online detractors.

Unsurprisingly, tweets like those did not quell the outrage at her remarks, which were offensive to many.

The investigation

A university investigation was ordered. University president Joseph Castro said: "This was beyond free speech. This was disrespectful."

But as the clamour for her dismissal grew, civil liberties organisations, along with some prominent conservative writers, were among those to condemn the demands.

At the same time, Randa Jarrar found herself dealing with wholesale abuse, hate speech and threats. Her family's contact details were made public.

"I started receiving tweets from people who were followers of right wing... activists and alt-right Nazi white supremacist sympathisers. And these people were very angry," she says.

"People were texting my son and calling him all sorts of awful words, terrible slang for 'homosexual'," she says. "They were calling my sister at work. They even texted my brother.

"All of the hate mail I got had some sort of racial epithet attached to it," recalls Ms Jarrar, who is Muslim and Arab-American. "It was misogyny. It was fatphobia. It was homophobia. It was xenophobia."

Free speech on campus

Image copyright Getty Images Image caption Randa Jarrar

Randa Jarrar's story became the latest flash point in the battle over free speech on America's university campuses.

Free speech is of course a cherished American right, enshrined in the first amendment to the US constitution: "Congress shall make no law ... abridging the freedom of speech, or of the press".

Many say it's under threat. In March, President Trump signed an executive order linking funding for colleges to their promotion of freedom of speech.

Image copyright Getty Images Image caption Conservative students watched as President Trump signed the executive order

"Today, we're delivering a clear message to the professors and power structures trying to suppress dissent and keep young Americans... from challenging rigid, far left ideology," the president said at the time.

The president has, however, been somewhat less than consistent on the first amendment. For instance:

"Everybody believes in free speech," Sanford J Ungar, the director of Georgetown University's Free Speech Project told the Washington Post. "Until you get to the topic on which they don't."

For many years, a narrative has developed that conservative speech is under threat at US universities where professors, administrators and many students lean liberal.

The idea has been reinforced since Trump took office, by high-profile confrontations at the Berkeley campus of the University of California and elsewhere.

By one key measure, the picture is decidedly mixed. The Foundation for Individual Rights in Education maintains a database of disinvitation efforts on US campuses. They've identified only a few dozen per year over the last two decades. In 2018, there were just 17, in a country with more than 5,000 colleges and universities.

Since 2000, twice as many attempts have been made to stop right-wing speakers than left-wing ones. But attempts to disinvite speakers from the left were more successful proportionately.

Campus confrontation

In September 2018, classes at Fresno State started up again. It was the first time Ms Jarrar had taught on campus since her tweets went viral.

Waiting for her outside the classroom was Ben Bergquam, a local talk radio host. Wearing a red "Make America Great Again" hat, he clutched a phone, live streaming to his followers on Facebook.

Mr Bergquam had been at the protests in Berkeley the previous year. He had come to the Fresno State campus not to defend free speech, but to try to take down Ms Jarrar.

Media playback is unsupported on your device Media caption Trouble breaks out amid protests at the Berkeley campus in 2017

"Do you want to make any comments about the first day of class with hateful professor Randa Jarrar?" he asked students as they streamed out of the classroom. Then to the professor: "Do you stand by your comments?

"Shame on you Randa."

Bergquam did not respond to requests for comment, but his actions didn't have the desired effect. Randa Jarrar exited the classroom shielded by a group of women singing "Ain't no Mountain High Enough" - and confident that she would be able to continue in her job.

First Amendment

After the investigation, Joseph Castro, the university president, had confirmed that no action would be taken against her.

He called her tweets "disgraceful" but concluded that they were indeed "protected free speech under the first amendment".

Given the outcry, does the professor herself have any regrets? Well, not really.

"The only thing I would do differently would be to make sure that my address and my families' addresses were no longer in the public domain," she says.

Image copyright Getty Images

You can follow BBC Trending on Twitter @BBCtrending, and find us on Facebook. All our stories are at bbc.com/trending.