When suspending Caleb O’Neil for recording his professor’s rant against then-President-elect Donald Trump, the dean of Orange Coast College said that the punishment should make the student “truly think through your actions and the consequences of those actions.”

But it was the college that rethought its actions — after two weeks of intense criticism that the California school was stifling a conservative student to protect a liberal professor.

The school canceled the suspension during a special board meeting Thursday, according to the Orange County Register, and issued a statement:

“The board believes this is in the interest of fairness and equity for all.”

“All” would include O’Neil — a 19-year-old Trump supporter — and his psychology professor Olga Perez Stable Cox, who called Trump a white supremacist in a classroom rant that O’Neil helped make viral.

Shortly after Election Day, Cox told her human sexuality class that Trump’s victory was “an act of terrorism.”

“We’re really back to being in a civil war,” the psychology professor said as O’Neil and others listened.

She didn’t mean a real war, but rather a divided country in which “we are the majority. More of us voted to not have that kind of leadership.”

The professor said “we” — but O’Neil thought otherwise.

“I pulled my phone out, because I was honestly scared that I would have repercussions with my grades because she knew I was a Trump supporter,” said O’Neil at a news conference earlier this month, according to the Register.

He recorded the speech and showed it to a campus Republican group, which complained to administrators that Cox was abusing the power of her grade book.

Frustrated that the administration did not act on their concerns quickly enough, the Republicans posted clips of the lecture online.

O’Neil’s video prompted headlines across the country and drew a ferocious backlash to the Costa Mesa, Calif., campus.

Cox told The Washington Post that she’d been trying to comfort students scared by Trump’s rhetoric against Muslims, undocumented immigrants and other minority groups.

After weeks of threatening emails and voice mails about the video — calling her a “Marxist,” “nut case” and “vile leftist filth” — she became frightened herself.

“I feel like I’ve been attacked by a mob of people all across the country,” she said in December.

She fled her home and turned her class over to a substitute after getting an email that listed her home address, phone number and salary — and threatened to spread the information “everywhere.”

Several weeks later, on Feb. 9, O’Neil got a letter from the dean.

“When we spoke, you stated that you felt badly about the things that had happened to individuals as a result of this incident,” it read.

It also spelled out his punishment. A semester-long suspension, because he had broken campus rules against using recording devices. And, according to a copy of the letter posted by Campus Reform, he also had to apologize to the professor and submit a double-spaced essay about “why you decided to share the video” and “the ensuing damage to Orange Coast College students, faculty and staff.”

Instead, O’Neil appealed, threatened to sue the school and co-wrote an essay in the Register with his new attorney and another Republican.

“An emerging sinister force is suppressing free speech throughout American universities,” the column reads. “Conservative students are under attack.”

The paper’s editorial board followed up with its own opinion, calling the punishment: “a full-fledged assault on free speech” and “absolutely disgusting.”

The Register promised daily editorials against the suspension until it was rescinded or the school’s trustees recalled and its president was fired.

By contrast, the school tried for a conciliatory tone as it backed down.

“It is time to move forward with increased empathy and understanding of the differences that have (existed) and will exist on … campus,” its statement reads, according to the Register.