The teacher who was beheaded in a street in France had received threats after showing controversial cartoons of Prophet Muhammad to his pupils, French media reported. He has been identified as 47-year-old Samuel Paty, a history and geography teacher.
Nine people have been arrested, including the parents of a child at Paty's school, judicial sources were quoted as saying.
Police say the attacker was an 18-year-old man of Chechen origin.
The killing took place while a trial is underway in Paris in a 2015 Islamist assault on the French satirical magazine Charlie Hebdo, which was targeted for publishing the cartoons, the BBC reported.
President Emmanuel Macron said the attack bore all the hallmarks of an "Islamist terrorist attack" and the teacher had been murdered because he "taught freedom of expression".
Speaking at the scene hours after the incident, he stressed national unity. "They will not prevail, they will not divide us," he said.
The attack occurred at about 15:00 (GMT) near the College du Bois d'Aulne, where he taught, in the town of Conflans-Sainte-Honorine, some 30 km (20 miles) north-west of central Paris.
A man wielding a large knife attacked the teacher in the street, cutting off his head. Witnesses are said to have heard the attacker shout "Allahu Akbar".
A picture of the beheaded teacher was posted on social media in the immediate aftermath, but it is not clear if this was by the assailant or an accomplice.
The attacker then ran from the scene but was chased by local police who had been alerted by the public.
The officers confronted the man in the nearby town of Eragny.
When they shouted at him to give himself up, he is said to have threatened them. The officers shot him and he died a short while later.
Police have said the attacker was an 18-year-old, born in Moscow but from Russia's predominantly-Muslim southern region of Chechnya. He was living in Évreux in Normandy. His grandparents and brothers are among those arrested.
Teachers across France told journalists of their fear, stunned by the targeting of a colleague murdered in broad daylight in a quiet suburban street.
France has seen a wave of Islamist violence since the January 2015 attack, which left 12 people dead including famous cartoonists.
Three weeks ago, as the trial got underway, a man attacked and injured two people outside the magazine's former offices.