Warning: This article contains details that may disturb some people.
The teenager who beheaded a teacher outside the school in a Paris suburb where he taught had approached pupils in the street and asked them to point out his victim, anti-terrorism prosecutor Jean-Francois Ricard says.
A photograph of the teacher's body, accompanied by a message claiming responsibility posted on Twitter, was discovered on the assailant's phone, found near his body. Ricard said the Twitter account belonged to the attacker.
The post was removed swiftly by Twitter, which said it had suspended the account because it violated the company's policy. The teacher killed has since been identified as Samuel Paty, who had shown his pupils cartoons of the Prophet Mohammad in a class on freedom of expression, angering several Muslim parents.
Muslims believe that any depiction of the Prophet is blasphemous.
"I want to share with you my total indignation. Secularism, the backbone of the French Republic, was targeted in this vile act," Prime Minister Jean Castex said.
Meanwhile, France is preparing to expel 231 foreigners on a Government watch list for suspected extremist religious beliefs, a police union source said on Sunday (local time).
France's interior ministry, responsible for expelling foreigners, was not available to confirm the information, which had been initially reported by Europe 1.
France defines extremists as "people who, engaged in a process of radicalisation, are likely to want to go abroad to join terrorist groups or take part in terrorist activities".
President Emmanuel Macron's centrist Government has been under pressure from conservative and far-right parties to take a tougher stance on non-nationals deemed to pose a security threat.
Interior Minister Gerald Darmanin asked local prefects to order the expulsions at a meeting on Sunday afternoon, according to the source and Europe 1.
Of the total number of suspects, 180 people are currently in prison and 51 were due to be arrested in the next hours, the police union source said.
Darmanin also asked his ministry's services to examine more closely the requests of people wishing to obtain the status of refugee in France, according to the source.
The 18-year-old suspected Islamist who beheaded a history teacher outside his school on Friday was born in Russia of Chechen origin and had refugee status.
Macron held a Defence Council meeting with senior cabinet ministers on Sunday.