A professor reportedly veered way off course during one of his lectures at Utah Valley University, and now, he is in the middle of a criminal investigation. 

In court documents, KSL reports the 42-year-old, who is a part-time economics professor, revealed to his students that he allegedly watched child pornography, which understandably drew a number of complaints from his pupils.

During his lecture in question, which was initially about macroeconomics, he began talking about "viewing child pornographic materials," a court document states.

He said, in part, "Tonight I am going to beg your pardon to share my filth with you."

"The very worst thing that I can share with you is the fact that I have seen youth — beautiful, wonderful children of this earth, in compromising positions, and sexual positions...If we are talking about a line in the sand then we are taking it south of an area that we shouldn’t be...I’m sorry, but I have seen that."

His class was being video streamed and recorded on a USB drive on Dec. 3, which was subsequently brought to the attention of the UVU Police Department. Authorities went on to share details with the Department of Homeland Security.

A day after the incident, Laura Carlson, the school’s director of Equal Opportunity/Affirmative Action, "confronted" the professor, according to an affidavit, and he "tendered his resignation."

The professor has not yet been charged with a crime, however, he no longer has his job at UVU. University spokesman Scott Trotter released a statement on Wednesday, stating in part that the person in question "was employed at Utah Valley University from August 2014 to December 2018" and that "he no longer works at the university."

Though he is a free man, for the time being, an investigator with the Department of Homeland Security obtained a warrant to search the professor's home on Feb. 28 for any possible evidence that he was in possession of child pornography. It is unclear whether or not anything was found.

Utah Professor Child Porn A Utah professor is under scrutiny for allegedly saying he watches child pornography. Here, protesters from Students For a Democratic Society demonstrate on the University of Utah campus against an event where right wing writer and commentator Ben Shapiro is speaking on Sept. 27, 2017 in Salt Lake City, Utah. Photo: George Frey/Getty Images