Tens of thousands of people rallied in Paris and cities across France in solidarity with a teacher beheaded for showing pupils cartoons of the Prophet Mohammed, as President Emmanuel Macron promised swift action against online extremism.

Demonstrators on the Place de la Republique held aloft posters declaring: "No to totalitarianism of thought", and "I am a teacher" in memory of murdered colleague Samuel Paty.

French President Emmanuel Macron arrives at the scene of the attack
French President Emmanuel Macron arrives at the scene of the attack AFPTV / David CANTINIAUX

"You do not scare us. We are not afraid. You will not divide us. We are France!" tweeted Prime Minister Jean Castex, who joined the Paris demonstration on Sunday.

Castex was joined by Education Minister Jean-Michel Blanquer, Paris mayor Anne Hidalgo and junior interior minister Marlene Schiappa.

Some in the crowd chanted "I am Samuel", echoing the widespread "I am Charlie" cry after Islamist gunmen killed 12 people at the Charlie Hebdo satirical magazine in 2015 for publishing caricatures of the Islamic prophet.

The killing bore the hallmarks of "an Islamist terrorist attack", President Emmanuel Macron said as he visited the scene
The killing bore the hallmarks of "an Islamist terrorist attack", President Emmanuel Macron said as he visited the scene POOL / ABDULMONAM EASSA

Between bursts of applause, others recited: "Freedom of expression, freedom to teach."

"I am here as a teacher, as a mother, as a Frenchwoman and as a republican," said participant Virginie.

The Charlie Hebdo attack in 2015 unleashed a wave of Islamist violence and forced France into a national discussion about Islam's place in a secular society.

The beheading of a teacher on the outskirts of Paris has shocked France
The beheading of a teacher on the outskirts of Paris has shocked France AFP / Abdulmonam EASSA

After the magazine assault, some 1.5 million people gathered on the same Place de la Republique in support of freedom of expression.

The attack took place in Conflans Saint-Honorine, a northwestern suburb around 30 kilometres from central Paris
The attack took place in Conflans Saint-Honorine, a northwestern suburb around 30 kilometres from central Paris AFP / Laurence SAUBADU

On Sunday, President Emmanuel Macron ordered swift and "concrete action" to counter radical Islamist propaganda online.

At a meeting with six ministers and anti-terror prosecutor Jean-Francois Ricard, Macron said there would be "no respite for to those who organise to oppose the Republic's order".

The beheading of a teacher on the outskirts of Paris has shocked France
The beheading of a teacher on the outskirts of Paris has shocked France AFP / Abdulmonam EASSA

The presidency said action would be taken against anyone expressing support for the attack, without giving any further details Sunday.

And authorities said from Monday, they would investigate the authors of 80 messages of support for the attacker.

Ministers in France's defence council also agreed to step up security at schools when they return after half term.

The middle school where the teacher worked in Conflans-Saint-Honorine, a usually quiet northwestern suburb 30 kilometres from central Paris
The middle school where the teacher worked in Conflans-Saint-Honorine, a usually quiet northwestern suburb 30 kilometres from central Paris AFP / Bertrand GUAY

Over the weekend thousands rallied in cities across France, with hundreds of people marching in Nice on the south coast, where in July 2016 a man killed 86 people when he rammed a truck into a crowd.

"Everyone is in danger today," said student Valentine Mule, 18, attending the Nice rally. "Things have to change."

Paty was murdered on his way home from the school where he taught in a suburb northwest of Paris on Friday afternoon.

People hold a sign reading 'I am a teacher - Freedom of speech' outside the school where Paty worked
People hold a sign reading 'I am a teacher - Freedom of speech' outside the school where Paty worked AFP / Bertrand GUAY

A photo of the teacher and a message confessing to his murder was found on the mobile phone of his killer, 18-year-old Chechen Abdullakh Anzorov, who was shot dead by police.

Witnesses said the suspect was spotted at the school on Friday asking pupils where he could find Paty.

On Saturday, anti-terror prosecutor Ricard said the teacher had been the target of online threats for showing the cartoons to his civics class.

Depictions of the prophet are widely regarded as taboo in Islam.

The father of one schoolgirl had launched an online call for "mobilisation" against the teacher and had sought his dismissal from the school.

The parent had named Paty and given the school's address in a social media post just days before the assault, which Macron labelled an Islamist terror attack.

The father and a known Islamist militant who was involved in his campaign against Paty are among those arrested, along with four members of Anzorov's family.

An 11th person was taken into custody on Sunday, a judicial source said, without providing details.

Ricard did not say if the assailant had any links to the school or had acted independently in response to the online campaign.

The Russian embassy in Paris said Anzorov's family arrived in France from Chechnya when he was six to seek asylum.

Locals in the Normandy town of Evreux where the attacker lived described him as low key, saying he got into fights as a child but had calmed down as he became increasingly religious in recent years.

Friday's attack was the second of its kind since a trial started last month over the Charlie Hebdo killings.

The magazine republished the controversial cartoons in the run-up to the trial, and last month a young Pakistani man wounded two people with a meat cleaver outside Charlie Hebdo's former office.

Kamel Kabtane, rector of the mosque of Lyon and a senior Muslim figure, told AFP on Sunday that Paty was merely been "doing his job" and had been "respectful" in doing so.

A national tribute is to be held for Paty on Wednesday.