Four students at Wilhelm Dörpfeld Gymnasium, a high school in the western German city of Wuppertal, were wounded in a knife attack on Thursday.
Two of the victims were being treated in intensive care for severe injuries, according to local prosecutors.
Police say they have arrested a suspect, believed to be a 17-year-old male student at the school, who sustained "life-threatening injuries."
Herbert Reul, the interior minister of the state of North Rhine-Westphalia, said it appears the suspect was a lone perpetrator and that his injuries were self-inflicted.
Details of the attack are unclear, but one student told the German press agency DPA that a friend of his had seen two older pupils running down the stairs bleeding.
"I thought maybe they were fighting," he said.
They were instructed to go to their classrooms and lock the doors.
"We then pushed the desks in front of the door and sat on the floor at the back," he said. "We were very scared."
Other students reported similar experiences.
"We had English lessons, then an announcement was made that several pupils had been injured and the paramedics should come to the first-aid room," another pupil at the school told DPA.
According to prosecutors multiple knives were used in the attack.
Police rushed to the scene
A police helicopter was seen circling over the school, while police officers carrying submachine guns were among the large group of emergency responders at the site.
The school was then evacuated and roads around it were closed off.