The 50-year-old was ordered by the court to attend classes on how to better deal with difficult children. If he fails to attend the classes, he could face a fine of €1,000, reports Spiegel.
The reason for Wednesday's conviction on a count of "robbery of freedom" was the teacher's decision to make disruptive pupils write out a Wikipedia entry on a musician after class.
The pupils were then told to hand in their work one by one, but were not allowed to leave the classroom by the teacher, sat in the doorway with a guitar across his knees.
At some stage an inpatient pupil called the police.
The teacher also faced a charge of bodily harm after he struck one of the sixth graders in the stomach when he was handing his punishment in.
But the boy told the court that he couldn't say that the teacher had meant to hit him, and also that the impact "had only hurt for a short while".
The teacher, who was not found guilty on this charge, expressed relief at the ruling, saying that the classes on dealing with difficult kids could give him “some useful tips.”
According to the law in NRW, teachers are allowed to give pupils detention, but only after notifying parents.