For the best experience, please enable JavaScript in your browser settings.
Maribor, Slovania: Married father-of-two Drago Kamenik, 41, was spotted by students at the vocational high school in Maribor, a town in eastern Slovenia, in an intimate clinch with brunette maths teacher Manja Mertelj, 45, after they heard shrieks of pleasure coming from the empty classroom while they were on a break.
Capturing the two on a mobile phone camera through the door window the students then uploaded the footage onto a social networking site where it went viral.
One of the 18-year-old students, who did not want to be named, said in an online comment under the video: "We heard the noises and knew someone was having sex in there.
"But we thought it would be other students.
"We couldn’t believe it when we saw our maths teacher and headmaster."
The desperate head teacher had at first threatened to sue the pupils who filmed him, then denied it and said the film was a fake, and now, finally, he has killed himself.
A school colleague said after hearing of the death: "He felt he had no other way out.
"He tried to claim they were fake, but the students responded by saying they had other images where you could see his face even more clearly, and threatened to put those online as well."
Writing on social media, one student posted: "We know it was him because although you can’t see his face you can recognise the ring.
"We can put up more to prove it but I don't think anyone really doubts us."
Education officials have responded to the news of the man's death by announcing a hunt to find those responsible.
They said that the entire school in Slovenia is now under investigation after the headmaster's death following the footage being posted online.
The investigation is trying to find out who filmed it and who spread it.
Kamenik was found dead over the weekend and police confirmed it was a suicide, but gave no further details.
The maths teacher is on a sick leave and has still not commented on the matter.
Stay informed. Subscribe to our newsletter
The case has raised questions in Slovenia whether the media should have published the images and how ethical it was.