France’s anti-terrorism prosecutor’s office said authorities investigating the killing of Samuel Paty in Conflans-Sainte-Honorine on Friday arrested nine suspects, including the teenager’s grandfather, parents and 17-year-old brother.
Mr Paty had discussed caricatures of Islam’s Prophet Mohammed with his class, leading to threats, police officials said.
Islam prohibits images of the prophet, asserting that they lead to idolatry.
French anti-terrorism prosecutor Jean-Francois Ricard said an investigation for murder with a suspected terrorist motive had been opened.
Mr Ricard told reporters that the Moscow-born suspect, who had been granted a 10-year residency in France as a refugee in March, was armed with a knife and an airsoft gun, which fires plastic pellets.
His half-sister joined the Islamic State group in Syria in 2014, Mr Ricard said.
He did not give her name, and it is not clear where she is now.
The prosecutor said a text claiming responsibility and a photograph of the victim were found on the suspect’s phone.
He also confirmed that a Twitter account under the name Abdoulakh A belonged to the suspect.
It posted a photo of the decapitated head minutes after the attack along with the message “I have executed one of the dogs from hell who dared to put Mohammed down”.
Mr Ricard said the suspect had been seen at the school asking students about the teacher, and the headmaster had received several threatening phone calls.
Mourners marched near the school in solidarity on Saturday, holding signs that read: “I am a teacher.”
“We’ll pick ourselves up together, thanks to our spirit of solidarity,” said Laurent Brosse, mayor of Conflans-Sainte-Honorine.
A police official said the suspect was shot dead about 600 metres from where Mr Paty died.
Police opened fire after he failed to respond to orders to put down his arms and acted in a threatening manner.
French President Emmanuel Macron went to the school on Friday night to denounce what he called an “Islamist terrorist attack”.
He urged the nation to stand united against extremism.
“One of our compatriots was murdered today because he taught … the freedom of expression, the freedom to believe or not believe,” Mr Macron said.
The Elysee Palace announced that there will be a national ceremony at a future date in homage to Mr Paty.
In a video posted recently on Twitter, a man describing himself as the father of a student asserted that Mr Paty had shown an image of a naked man and told students it was “the prophet of the Muslims”.
Before showing the images, the teacher asked Muslim children to raise their hands and leave the room because he planned to show something shocking, the man said.
“What was the message he wanted to send these children? What is this hate?” the man asked.
Chechnya is a predominantly Muslim Russian republic in the North Caucasus.
Two wars in the 1990s triggered a wave of emigration, with many Chechens heading for western Europe.
France has offered asylum to many Chechens since the Russian military waged war against Islamist separatists in Chechnya in the 1990s and early 2000s.
France has seen occasional violence involving its Chechen community in recent months, believed linked to local criminal activity and score-settling.
This is the second time in three weeks that terror has struck France linked to caricatures of the Prophet Mohammed.
Last month, a young man from Pakistan was arrested after attacking two people with a meat cleaver outside the former Charlie Hebdo offices.
The weekly was the target of a deadly newsroom attack in 2015, and it republished caricatures this month to underscore the right to freedom of information as a trial opened linked to that attack.
Friday’s terror attack came as Mr Macron’s government works on a bill to address Islamic radicals, who authorities claim are creating a parallel society outside the values of the French Republic.