A student at Orange Coast College in California was suspended after secretly videotaping his teacher making anti-Donald Trump statements in class and was told to write an apology letter along with a three page-essay about the incident.

Caleb O'Neil recorded one of his teachers, Olga Perez Stable Cox, telling a class at the community college that the election of President Trump was "an act of terrorism," the Orange Country Register reported Wednesday night.

Because Coast Community College District policy prohibits recording someone on the district's property without their consent, O'Neil was suspended for the current semester and the summer term.

The school's interim dean of students, Victoria Lugo, wrote a letter to O'Neil on Feb. 9 that said she hoped that he learned from his actions.

"It is my hope that this experience will lead you to truly think through your actions and the consequences of those actions when making decisions in the future," Lugo wrote.

The video clip of Cox making the comments went viral in December.

William Becker, an attorney representing O'Neil, said the punishments are excessive and that the student's legal rights have been violated.

"This is an attack by leftists in academia to protect the expressive rights of their radical instructors at the expense of the expressive rights of conservative students on campus," said Becker, president of Freedom X, a nonprofit that seeks to preserve religious and conservative freedom of expression.

O'Neil, 19, filed an appeal with the school on Wednesday and gave a press conference.

The president of Orange Coast College, Dennis Harkins, said his administration will investigate if Cox's comments were appropriate and if it was in the context of the class's subject matter. It is unclear if that investigation has been concluded.

College spokesman Doug Bennett declined to discuss the investigation further, saying that the school cannot comment on personnel matters.

The three students who posted the video clips, all leaders of the school's College Republicans, received letters saying there was insufficient evidence to be used against them, according to one of the students, who went on to describe how the sanctions against O'Neil were excessive.

"I'm disgusted that they imposed such excessive sanctions against [O'Neil], especially when the student was just trying to document a case where he personally felt targeted by a faculty member and his student rights were violated," said Recalde-Martinez, who founded the school's College Republicans and until recently served as its president.

O’Neil has to describe why he videotaped the professor and his "thoughts and analysis" on the incident in a three-page double-spaced essay to be allowed back into school.

O’Neil took the video to leaders of the College Republicans group and complained to the school's administration. They argued Cox used her position in the classroom as a bully pulpit.

Cox, 66, said that as a gay Latina she was frightened by Trump's election

In the video, she compares the results of the election to the American Civil War.

"We're really back into being in a civil war. I don't mean it in a fighting way, but our nation is divided clearly as it was in civil war times," the teacher said.

She later called the election of Donald Trump "an act of terrorism" and claimed that people "leading the assault are among us."

Cox defended her statements in a recent interview, saying, "I didn't say anything wrong or do anything wrong. I didn't say anything that thousands of Americans weren't feeling or saying."

"I don't regret it," she added.

Cox said her goal was to assure the students, many of whom are minorities, that the campus is a safe place for them in case they face discrimination.

Cox later clarified her statement implying that Trump supporters are terrorists.

"I never said anyone was a terrorist. … A lot of us were in pain and were afraid because of all the things that had been said throughout the campaign and all the ways women and minority groups had been disrespected and made fun of," she said.

Rob Schneiderman, the president of the union that represents the district's faculty said he is satisfied "there were some consequences and someone is being held responsible."

"In this type of situation, nobody wins," he added.