BERLIN, Germany (CNN) -- A teenage student wielding an ax, two knives, and three Molotov cocktails attacked several children at his school in southern Germany Thursday, wounding nine before he was arrested, police said.
Two children were seriously wounded, as was the 18-year-old attacker, who was shot by police when they tried to arrest him, police spokeswoman Eike Schoenwald told CNN. Seven other children were slightly wounded, she said.
The teenager, whose name was not released, launched the attack at the Gymnasium Carolinum in Ansbach, which is midway between Frankfurt and Munich, said Ralf Koch, a spokesman for the Bavarian police.
Between 600 and 700 students attend the school, which includes grades seven through 13. The attacker was in the 13th grade, police said.
Police said they received an emergency call at 8:35 a.m. (2:35 a.m. ET). When they got to the school, they immediately smelled smoke in the building, and they then encountered the attacker in a hallway.
The teenager had lobbed two Molotov cocktails into classrooms, one of which caused a fire, said Udo Dreher of the local police. He had also attacked several students with the ax and knives, Dreher said.
Police shot the teenager several times because he threatened the police officers, said Joachim Herrmann, the minister of the interior for the state of Bavaria, where Ansbach is located. The siege ended at 8:46 a.m., he said.
The attacker suffered life-threatening wounds and is now being treated at a hospital, police spokesman Peter Grimm said.
The school was evacuated and all the children were moved to an employment center in Ansbach, Koch said.
The corridors at the employment center were "filled with children," the center's secretary told CNN.
CNN's Diana Magnay contributed to this report.