A Ferris State University professor who was suspended in January for making a profanity-filled video to welcome students settled his legal dispute with the school by agreeing to accept $95,000.

Barry Mehler also agreed to a three-year gag order. If he criticizes Ferris State University, he could be forced to pay $60,000.

Mehler, 75, also agreed to retire from the school instead of face termination. He taught history at Ferris State for decades. 

The professor was placed on paid leave in January for telling students in a video that "civilization is collapsing" and "life on your planet is going extinct," before telling students that they are "vectors of disease."

MICHIGAN GOP GUBERNATORIAL CANDIDATE KEVIN RINKE SEEKS TO END LASTING EFFECTS OF WHITMER'S COVID SHUTDOWNS

Michigan professor Barry Mehler wears a space helmet during a video for his students

This image from video provided and taken by Barry Mehler shows Mehler during a 14-minute YouTube video at the start of a new term at Ferris State University. Mehler was suspended after making the provocative video. (Barry Mehler via AP)

The 14-minute video got more than 500,000 views on YouTube. Mehler used profanities and made a sexual reference as he rambled on about his attendance policy, grades, plagiarism and COVID-19.

Mehler was upset with the university over its refusal to require COVID-19 vaccinations. He called students "vectors of disease" and said they didn’t need to attend class in person.

"You people are just vectors of disease to me and I don't want to be anywhere near you, so keep your f--king distance. If you want to talk to me, come to my zoom," Mehler said.

Mehler also told students that he is beholden to "no human c--ksucker" and has a "paying f--king union job."

Barry Mehler appears in a video he made for students

Barry Mehler agreed to resign from Ferris State University in Michigan after he made a crude video for students. (Barry Mehler via AP)

"I stand before you today beholden to no human c--ksucker and working a paying f--king union job and no limber d--k of an administrator is going to tell me how to teach my classes because I'm a f--king tenured professor," Mehler said.

JACOB HILLS DEATH: DETROIT POLICE INTERVIEWING FRIENDS WHO WERE WITH THE TEENAGER BEFORE HIS DISAPPEARANCE

He had a message for students who wanted to file a complaint with their dean: "F--k you."

"If you want to go complain to your dean, f--k you, go ahead, I'm retiring at the end of this year and I couldn't give a flying f--k any longer," Mehler said.

He later said that the speech he gave was adapted from an episode from HBO's Deadwood and used it to address the issue of plagiarism.

The professor filed a lawsuit against the university in late January, claiming it had violated his First Amendment right, according to Mlive.com.

Michigan professor Barry Mehler smiling in a picture

Barry Mehler smiles for a photo on Ferris State University's website. (Ferris State University)

CLICK HERE TO GET THE FOX NEWS APP

Mehler later told the Associated Press that he was performing in the video when speaking to students.

Multiple syllabi from Mehler's classes, obtained by Fox News Digital, contain a "trigger warning," which states, "Dr. Mehler takes on many personas, some of them are racist and some of them are sexist. As a result, Dr. Mehler uses profanity and what are ordinarily unacceptable racial and gender slurs. It is important for students to understand that Dr. Mehler is never expressing his ‘own’ opinions in class. He is always performing and always presenting opinions of others." 

Fox News' Adam Sabes and The Associated Press contributed to this report.