The 44-year-old doused herself in petrol during the morning break and set herself alight, one day after a stormy meeting with children in her class who found her teaching methods too strict, witnesses said.
"She should pull through," said state prosecutor Patrick Mathe, who added that the woman was suffering from depression and was seen as having tried to commit suicide. "It was a desperate act... there was no crime."
The teacher suffered third-degree burns in the incident at the Jean Moulin secondary school in Beziers, southern France, and was taken by helicopter to a specialist unit in the city of Montpellier's university teaching hospital.
Parents and pupils who spoke to AFP at the scene said the teacher had a difficult relationship with several pupils in her maths class and that a meeting with them to clear the air on Wednesday had become rowdy.
They said she came to school on Thursday morning with a jerry can, gave a class at 9.00am then, when the morning break came, walked to the centre of the yard, poured petrol on herself and set herself alight.
"I saw her body on fire, walking forward with her hands on her head," said one student witness, Karim. "Several people tried to put her out. She said 'No, leave me alone. I don't need help. God told me to do this'."
"The teachers put a blanket over her, her clothes had melted," Karim said.
Ten days previously, parents said, she had been hostile at a parent-teacher evening at the school, refusing to address their concerns about her methods.
Four parents, speaking on condition of anonymity, said that the teacher had refused to help out struggling pupils, preferring to kick them out of class and concentrate on helping the stronger children progress.
They noted that she had appeared at the parents' evening with unexplained cuts and bruises. Some said the same teacher had suffered a nervous breakdown the year before and had been in trouble with school authorities.
The school -- a huge institution housing 3,000 students and 280 teachers -- sent all of its pupils home after the incident, and a crisis cell was set up to deal with its aftermath.
Education Minister Luc Chatel headed to Beziers to meet school officials.
"The minister shares the shock and sadness of the staff and students of the school. He asked for all information to try to understand what could have driven this teacher to carry out this act," the ministry said in a statement.