(The Associated Press/Str)
"The hostage-taking is over," an aide to the mayor of the eastern French city of Besancon, Jean-Marc Magda, said in a telephone interview.
All 20 children who had been seized and their teacher were released safely, he said.
The hostage-taker, allegedly suffering from depression and asking for a gun to kill himself, was detained by police officers from the elite GIPN force, who slipped into the school as the children were being brought lunch, education minister Luc Chatel said.
He was first neutralized with a shot from an electric pistol, said Laurent Gresset, regional chief of the Alliance police union.
"We brought in meals, and it was at that moment that the GIPN was able to intervene, separate the children, free them and apprehend the hostage-taker," Chatel said in televised comments from the scene after the four-hour-long ordeal.
French television showed a wide-eyed girl being draped in a green blanket and carried away from the school. Police and worried families had surrounded the Charles Fourier preschool in Planoise, a neighborhood of housing projects with a large immigrant population on the western edge of Besancon.
The hostage-taker, known in the neighborhood, had allowed groups of children to leave during the ordeal. Applause erupted as the last five were led from the school after the police intervention.
Reports of the arms wielded by the hostage-taker varied, but Chatel said he carried "two long knives." He said the hostage-taker had wanted to kill himself "in the classroom."
"It was [the hostage-taker] who contacted police ... He asked several times for a weapon to kill himself," Chatel said on France-Info radio, apparently referring to a gun. "Beyond that, he expressed no violence toward the children."
Described by officials as depressive, the teen appeared to be gentle with his preschool hostages.
He never threatened the children, even allowing them to go to the bathroom, Chatel said. Several parents interviewed on French television said their children seemed unaware of the gravity of the drama, and many colored to pass the time.
Besancon Mayor Jean-Louis Fousseret said the teen had been treated for depression, but had not taken his medication in recent days.
"From the start, police understood he wanted to hurt himself more than the children and the teacher," Gresset said. Police talked with the young man throughout the ordeal "so he would turn himself in peacefully and not kill himself."
The hostage-taker initially seized a class of 20 children but released at least 14 throughout the morning, including one who "more or less escaped," Fousseret said.
Five children and the teacher were still in the preschool when the officers entered at lunchtime, he said on i-tele television.
The masked gendarmes pointed their firearms at the school's windows and doors as they entered, in images shown on French TV. They were in contact by telephone with the hostage-taker before the last group of children was released.
Families huddled around the school, with children bundled against the cold. Emergency workers draped a blanket over one woman's shoulders as she wept.
Pupils were still inside the adjacent elementary school while the events unfolded.
"It's a bit traumatizing. ... We are just across from where everything is happening," principal Alain Lietta said. The schools' entrances are about 60 yards apart. Normally some children go home at lunch but "today, this posed a problem," he said.
President Nicolas Sarkozy welcomed the "happy ending" to the hostage-taking. In a statement, he expressed support for the teacher taken hostage and the school personnel, and praised the "professionalism and determination" of the police and gendarmes who helped free the children.