A masked man opened fire with a pistol in a high school in northwestern Germany, wounding eight people Monday in an attack that ended with his death, police said.

It was not immediately clear how the man died. Police spokesman Klaus Laackmann would not say whether the man killed himself or was killed by police.

Explosives were found near the man's body, Laackmann said.

N-tv television reported that the assailant was an 18-year-old former student at the school.

He entered the Geschwister School school in Emsdetten, near the Dutch border, at about 9:30 a.m., and fired several shots, police spokesman Josef Brinker said.

Several students, a female teacher and the head caretaker were among the wounded. Their injuries were not life-threatening, Laachmann said.

"The building is clear, all the children are safe, the perpetrator is dead," Laackmann said.

Click here to go to FOXNews.com's Europe Center.