The French president describes it as a “cowardly attack”, saying the man was killed because he “taught the freedom of expression”.
The teacher had recently discussed caricatures of the Prophet Mohammed in class, according to police sources.
France‘s anti-terror prosecutor said it was investigating the fatal attack, which took place in Conflans-Sainte-Honorine, a suburb north-west of Paris.
President Emmanuel Macron headed to the scene following an emergency meeting at the French interior ministry.
The attacker, whose identity has not been established, was shot by police as they tried to arrest him a few streets away and later died of his injuries.
“A week before this attack, the teacher had given a course on secularism in his class and he asked his Muslim students to leave the room because he was going to show some cartoons of the Prophet Mohammed that could have caused offence
The grisly murder was an attack on the French nation as a whole, Education Minister Jean-Michel Blanquer said on Twitter.
“Our unity and our resolve are the only responses faced with the monstrosity of Islamist terrorism,” the minister wrote.