The sex act allegedly occurred inside a classroom Getty

A married headteacher is preparing to take legal action after footage of him allegedly performing oral sex on a female maths teacher went viral online.

Drago Kamenik, 41, was allegedly caught engaging in the sex act in a classroom by students at their school in Slovenia.

The pupils are said to have found the educator in a comprising position during school hours after hearing moans of pleasure coming from the supposedly empty room.

"We heard the noises and knew someone was having sex in there," one 19-year-old student told the Slovenske Novice.

"But we thought it would be other students. We couldn't believe it when we saw our maths teacher and headmaster."

But Kamenik, a father-of-two, condemned the footage as fake and threatened to sue those responsible for posting the clip on social media.

"The man in the video is not me, it has been photoshopped. I also spoke to my wife," he said.

"Can these fools even begin to imagine what damage they have caused by doing this?! As for the maths teacher, she is a very good teacher and has had many positive things said about her."

However, students dismissed his threats.

"We can put up more to prove it but I don't think anyone really doubts us," said one student on social media.