A secondary school pupil stabbed several classmates before turning the knife on himself on Thursday in an attack in the western German city of Wuppertal, police said.
The suspect was taken into custody with "life-threatening injuries", a spokesman for Duesseldorf police told AFP.
Several pupils were severely wounded in the attack, although none of the injuries posed a risk to life, the spokesman said.
The spokesman confirmed estimates from local media that up to five pupils had been wounded.
He said the school had sent a message to parents informing them the attacker was a 17-year-old pupil who had been experiencing a manic depressive episode.
Local police said mid-morning that they were responding to an emergency at the school.
"We are on site with a large number of officers," Wuppertal police said on X, formerly Twitter.