A university professor from Utah is under criminal investigation after allegedly telling students during a class that he watched child pornography.

The part-time economics professor, 42, at UVU was lecturing students on macroeconomics when he suddenly 'confessed to his class of students about his child pornography addiction,' KSL.com reported.

The class was video streamed and was recorded on a USB drive on December 3.

This was then presented to the UVU Police Department, which subsequently contacted the Department of Homeland Security.

A professor who worked at Utah Valley University, (pictured), is under investigation after allegedly admitting to students that he watched child porn

Investigators reviewing the recorded classroom lecture noted that about 90 minutes into his class, he 'ceases his discussion of the subject matter related to macroeconomics and begins talking to his students about taking them on a/his 'spiritual journey.'

He then goes on to talk about his involvement with 'viewing child pornographic materials,' a court document states.

The lecturer went on to say: '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.'

While continuing to apologize, the professor told the class that he had not touched anyone inappropriately and does not keep 'a library' of pornographic images, 'except what is in his head.'

'If you are a human being who I saw, I am not sorry that I saw you … as terrible as that sounds. I am sorry that I looked at you in that way. … I am sorry that I chose to look at you in that way,' he told the class, according to the warrant.

A number of students made complaints with the UVU Ethics Point Complaints program due to 'the graphic nature of (his) classroom confession to viewing child pornographic materials.'

In it the student said: 'He started talking about how he had never inappropriately touched a child and in a roundabout way, he talked about I'm guessing his pornography addiction (I don't think I actually heard him say 'pornography'),' wrote one student.

A number of students made complaints with the UVU Ethics Point Complaints program due to 'the graphic nature of his classroom confession to viewing child pornographic materials'

'After that, he said he was going to take us on 'a spiritual journey' and … that is when I decided to leave class (because I didn't want to go on a spiritual journey. … That has nothing to do with macroeconomics),' the student continued in the affidavit.

'So, it was SUPER weird, and I just don't feel like it was an appropriate thing to do in a macroeconomics class.'

The Department of Homeland Security obtained a warrant to search the professor's Midway home on February 28 to seize electronic equipment or disks that could potentially contain child pornography.

The warrant does not state if anything was seized or if any pornography was found.

On December 4, the professor 'was confronted about his in-class confession' by Laura Carlson, the school's director of Equal Opportunity/Affirmative Action, and he 'tendered his resignation,' according to the affidavit.

The professor has not been arrested or charged, according to KSL.com.

University spokesman Scott Trotter released a statement on Wednesday saying that the man 'was employed at Utah Valley University from August 2014 to December 2018.' It said that he no longer works there.