The 22 hostages were all released unharmed, the officials said on Thursday.
Earlier, the hostage-taker, armed with a hand gun, promised not to harm the students, held in an upper-floor study hall.
Police cordoned off the area and took up positions around the Colbert de Torcy High School in Sable-sur-Sarthe, outside Le Mans, the city famed for its 24-hour annual car race about 230 km southwest of Paris.
A crack intervention squad, the GIGN, headed to the school via helicopter from Villacoublay military airport west of Paris, police said. Nicolas Sarkozy, the interior minister who was on a visit to Guadeloupe, said he was following the situation closely.
Prosecutor Jean Elek informed families of the students held hostage of the situation, Le Mans court officials said. A crisis centre for parents was set up on the school grounds.
A school receptionist said the students were aged 16 to 18 and were held in a classroom on an upper floor of the public school, which has 1500 students, about 300 of them boarders.
"We knew him, so we simply let him in. He seemed totally normal"
"He promised a teacher's assistant that he would do no harm to the students," the receptionist, Bernadette Mercier, told The Associated Press by telephone.
Mercier did not name the hostage taker but said he was aged 33. She said he had been "very, very depressed" two years ago because of personal problems and now was apparently seeking work.
Mercier, who was not in the same building as the hostages, said the incident started at 2:30 pm (1330 GMT) on Thursday.
"We knew him, so we simply let him in," she said in the telephone interview. "He seemed totally normal."