French police have shot dead a man suspected of fatally stabbing a teacher just minutes earlier on the streets of a Paris suburb.

The teacher had shown pupils in his class cartoons of the Prophet Mohammad, which are considered by Muslims to be blasphemous, according to a police source.

France's anti-terror prosecutor said it was investigating the attack, which took place in Conflans Sainte-Honorine, a suburb north-west of Paris.

French President Emmanuel Macron said the killing bore the hallmarks of "an Islamist terrorist attack".

Speaking near the scene, a visibly moved Mr Macron also said that "the entire nation" stands ready to defend teachers and that "obscurantism will not win".

French President Emmanuel Macron speaks to the media near the scene of the stabbing

Education Minister Jean-Michel Blanquer tweeted: "The Republic is under attack", adding that "our unity and firmness are the only answers to the monstrosity that is Islamist terrorism". 

Minister of State for European Affairs, Thomas Byrne, posted a message of support - written in French - on Twitter following the incident.

It translates as "Ireland stands in solidarity with France against terrorism. I think with sadness of the family and students of this victim. Freedom. Equality. Fraternity."

Prosecutors said they were treating the incident as "a murder linked to a terrorist organisation" and related to a "criminal association with terrorists".

A police source said the victim had been decapitated in the attack, but this was not confirmed.

The suspected assailant was spotted by a police patrol while carrying a knife a short distance from the scene of the attack.

They opened fire and injured him severely. The man later died of his injuries, a judicial source said.

A police source said that witnesses had heard the attacker shout "Allahu Akbar", or "God is Greatest". The police spokesman said that information was being checked.

French police on guard in the Paris suburb of Conflans Sainte-Honorine

French Interior Minister Gerard Darmanin said he had set up a crisis centre to deal with today's attack, and was keeping President Emmanuel Macron informed.

Over the past several years, France has seen a series of violent attacks carried out by Islamist militants.

Late last month, a man who emigrated to France from Pakistan used a meat cleaver to attack and wound two people outside the former offices of satirical magazine Charlie Hebdo.

That was the spot where Islamist militants shot dead employees of the magazine five years ago in retaliation for its publication of cartoons of the Prophet Mohammad.