The spokesman also said a 23-year-old male suspect had been arrested and it was unclear if other people had been injured.

A different spokesman for police in the state of Rhineland-Palatinate told Germany's N-TV television that an armed male had attacked a teacher but that the school was no longer under threat.

German media reported the attacker had used a knife but police declined to confirm that.

Germany has suffered several major school shootings in recent years.

Last March a teenager went on the rampage in the southwestern town of Winnenden near Stuttgart and killed 15 people before killing himself.