The teacher, who missed a month in the classroom due to an eye injury sustained from a snowball lobbed by a student, is entitled to standard compensation for work accidents, the administrative court in the southwestern city of Freiburg said in a summary of the ruling made in December.
This applies even if snowball fights are officially banned by the school, the judges added.
As the teacher entered the courtyard, a group of about 15 pupils began pelting him with snowballs.
He initially tried to defend himself by guarding his face with a folder, telling the pupils it was unfair to gang up on him and knocking the snowballs from their hands. But he eventually joined in.
The school board had argued that the teacher had thus abandoned the hierarchical relationship with his pupils and acted as an "equal" when he started hurling his own snowballs back at them, the court said.
The plaintiff, who was not identified by name, was hit directly in the eye in the melee and required an operation that kept him from work for a month.
However the judges found that the teacher "because of his good relationship with the students, saw their snowball assault not as mean-spirited but as an expression of fun and a challenge."
He argued that "if he had stuck to a demand for them to stop and walked away, he would have made a fool of himself as a teacher".
The court added that it thus saw his wound as a work injury but noted that the interpretation could not be applied to clearly "excessive" behaviour such as a fist fight after a company holiday party or drunken driving on the job.
The school board may still appeal.