French government spokesman Olivier Véran confirmed Wednesday's attack and said the perpetrator was 16 years old.
Police attended Saint-Thomas d'Aquin school with the local prosecutor, where the student was arrested.
French newspaper Sud Ouest said the attacker entered the classroom while the teacher was giving a Spanish class and attacked her.
The teacher was in her 50s and died of cardiac arrest after emergency services arrived at the school, local media reported.