A French school teacher has been stabbed to death in front of her class by the mother of one of her students, in the southern town of Albi.

The 34-year-old teacher, who has not yet been named, was assaulted in her classroom just after the doors of the Edouard-Herriot elementary school opened at 9am local time. The attack has shocked the country.

"This morning, a mother arrived with a knife and stabbed a teacher aged 34 in front of the children for reasons that are going to be determined by an investigation," said Albi prosecutor Claude Derens.

Authorities said the woman suffered from serious injuries and a cardiac arrest. She died a couple of hours later, despite emergency services attempt to revive her.

The attacker, 47, fled from the scene but was arrested nearby some 20 minutes later and is now in police custody.

According to some reports, the student's mother was already known to local authorities as earlier this year she was placed under investigation for child neglect and failing to report a child's disappearance, in order to prevent or delay search efforts.

The Edouard-Herriot elementary school hosts some 284 children aged between three and 11. Albi is famous for its mediaeval cathedral and historic town centre, which are listed as World Heritage Sites by Unesco.

Education minister Benoît Hamon said he was "saddened" by the news and interrupted his activities in Paris to fly to Albi.

"The minister is deeply shocked by this crime that plunges into mourning the end of the school year," the ministry said, adding that psychological assistance was to be provided to students who witnessed the crime.

President Francois Hollande expressed his sympathy for the family of the teacher.