PARIS/CONFLANS-SAINTE-HONORINE, France—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 said on Saturday.
Police shot dead the 18-year-old attacker, who was born in Russia, minutes after he murdered 47-year-old history teacher Samuel Paty in broad daylight in Conflans-Sainte-Honorine on Friday.
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.
Ricard quoted the message as saying: "In the name of Allah the most gracious, the most merciful, ... to (President Emmanuel) Macron, leader of the infidels, I have executed one of your hell-hounds who dared to belittle (Prophet) Mohammad."
Earlier this month Paty had shown his pupils cartoons of the Prophet Mohammad in a class on freedom of expression, angering a number of Muslim parents. Muslims believe that any depiction of the Prophet is blasphemous.
The attacker, of Chechen origin, had been living in the town of Evreux northwest of Paris, and was not previously known to the intelligence services, Ricard told a news conference.
The anti-terrorism prosecutor confirmed police were holding nine people in custody in connection with the attack.
The killing shocked the country and carried echoes of an attack five years ago on the offices of satirical magazine Charlie Hebdo. Prime Minister Jean Castex said it bore the hallmarks of Islamist terrorism.
"I want to share with you my total indignation. Secularism, the backbone of the French Republic, was targeted in this vile act," Castex said.
Four close relatives of the attacker were detained soon after the attack. Five more were detained overnight, including the father of a pupil at Paty's school, College du Bois d'Aulne, and an acquaintance of the pupil's father known to the intelligence services.
In the days after the lesson on freedom of expression, the pupil's father recorded several videos in which he branded the teacher a thug and called for him to be fired. In one, he urged others to "join forces and say 'stop, don't touch our kids.'"
The videos were shared on social media.
The half-sister of the pupil's father had joined the ISIS terrorist group in Syria in 2014, the prosecutor said. It was not immediately clear if the teenage attacker knew either the pupil's father or the father's acquaintance.
Parents of pupils laid flowers at the school gate. Some said their children were distraught.
"(My daughter) is in pieces, terrorized by the violence of such an act. How will I explain to her the unthinkable?" one father wrote on Twitter.
In an outpouring of grief, the hashtag #JeSuisSamuel (I am Samuel) trended on social media, like the #JeSuisCharlie call for solidarity after the attack on Charlie Hebdo in 2015.
Before that attack, Charlie Hebdo had published caricatures of the Prophet Mohammed, unleashing divisions that still cast a pall over French society.
Muslim leaders condemned Friday's killing, which many public figures perceived as an attack on the essence of French statehood and its values of secularism, freedom of worship, and freedom of expression.