A teacher in the municipality of Gislaved was fined 8,000 kronor ($1,165) for performing a "Heil Hitler" salute in front of students.
He explained the choice of gesture as "a bad joke" to the local Värnamo Nyheter newspaper.
The district court considered that his behaviour was enough to be classified as a minor count of racial agitation (hets mot folkgrupp).
The law is meant to protect against harassment of people based on, for example, their ethnicity, religion, sexuality and gender.
The incident occurred this spring when the teacher walked into a classroom during an ongoing German class. He stood in front of the students saying "Heil Hitler" while doing the infamous arm and hand gesture.
At one point the teacher even stood behind the German teacher, counting out loud "ein, zwei, ein, zwei", reported the paper.
The school head reported the incident to the police and the teacher resigned before the trial. The man is now working in another municipality.
This is not the first time a Swede has gotten in trouble for performing the gesture. Last year a man in Malmö was sentenced to 100 hours of community service for doing the salute in public.