A French teacher who had recently shown students cartoons of the Prophet Mohammed was beheaded outside his school on Friday, in what President Emmanuel Macron called an "Islamist terrorist attack". The victim, who has been named as 47-year-old Samuel Paty, had been the target of online threats, according to France's anti-terror prosecutor. The assailant was named as Abdullakh A, an 18-year-old from Chechnya with refugee status in France. It is not known what links he had to the school. The father of a schoolgirl had sought Paty's dismissal and launched an online call for "mobilisation" against him after the lesson on freedom of expression, prosecutor Jean-François Ricard said. The girl and her father lodged a criminal complaint against the teacher, who responded by filing a complaint of defamation, said Mr Ricard. The aggrieved father named Paty and gave the school's address in a social media post just days before the beheading. Abdullakh A was shot by police as they tried to arrest him and later died of his injuries. He had been armed with a knife, an airgun and five canisters and tried to attack police as they closed in on him. The Russian embassy in Paris said the murder had no relation to Russia because Abdullakh A had lived in France for 12 years. France has seen several acts of extremist violence since the 2015 terror attacks on the satirical magazine <em>Charlie Hebdo</em> and a Jewish supermarket in the capital. French anti-terror prosecutors said they were treating the latest assault as "a murder linked to a terrorist organisation". The attack happened on the outskirts of Paris around 5pm near the middle school where the teacher worked in Conflans Saint-Honorine, a north-western suburb around 30 kilometres from the city centre. The killing bore the hallmarks of "an Islamist terrorist attack", Mr Macron said as he visited the scene late on Friday. Visibly moved, the president said that "the entire nation" stood ready to defend teachers and that "obscurantism will not win". "One of our fellow citizens was assassinated today because he was teaching, he was teaching pupils about freedom of expression. Our compatriot was flagrantly attacked, was the victim of an Islamist terrorist attack," he said. Mr Macron said Paty's killing was an attack on French values. "The whole country stands behind its teachers. Terrorists will not divide France, obscurantism will not win," Mr Macron said. “I want to tell all of France’s teachers that we are with them, that the whole nation will be here on their side today and tomorrow to protect them, defend them, allow them to do their job, the most beautiful job of raising free citizens. It’s not a coincidence if tonight a teacher was struck. "Because he [the attacker] wanted to attack the values of the Republic, its light, the possibility to make our children, no matter where they come from, no matter what they believe or not believe, no matter what their religion is, to make them free citizens. That battle is our battle and it’s an existential one," he added. Two of the suspect's brothers and his grandparents were initially detained by police for questioning. A judicial source told AFP on Saturday that five more people had been detained, including the parents of a child at the school and friends of the suspect. The victim was a history teacher who recently showed cartoons of the Prophet Mohammed as part of a class discussion on freedom of expression, police said. A parent of a pupil at the school said the teacher might have stirred "controversy" by asking Muslim pupils to leave the room before showing the cartoons. "According to my son, he was super nice, super friendly, super kind," the parent, Nordine Chaouadi, told AFP. The teacher "simply said to the Muslim children: 'Leave, I don't want it to hurt your feelings.' That's what my son told me," the parent said. According to a judicial source, an identity card found on the assailant indicated he was born in Moscow in 2002, although investigators were waiting for formal identification. Police said they were investigating a tweet posted from an account that showed a picture of the teacher's head, and which has since been shut down. It was unclear whether the message, which contained a threat against Mr Macron – described as "the leader of the infidels" – had been posted by the attacker, they said. Residents in the usually calm neighbourhood said they were shocked while pupils from the school, some accompanied by their parents, gathered in the street checking their phones for updates. "Nothing ever happens here," said Mohand Amara, who lives nearby, as he walked his dog not far from the school. "I saw him [the teacher] today, he came to my class to see our teacher. It's shocking that I won't see him again," said Tiago, a student in sixth grade. "It makes me sad – decapitated, that's shocking," said 15-year-old Virginie, who used to be the murdered teacher's student and said she had "good memories" of him. Police had arrived at the scene after receiving a call about a suspicious individual loitering near the school, a police source said. They discovered the dead man and soon spotted the suspect, armed with a blade, who threatened them as they tried to arrest him. They opened fire and injured him severely. The scene was cordoned off and a bomb disposal unit dispatched because of the suspected presence of an explosive vest, according to police. France's parliament suspended Friday's debate after news of the decapitation, with session president Hugues Renson, visibly moved, calling the attack "abominable". MPs stood as Mr Renson said that "in the name of all of us, I want to honour the memory of the victim." "This evening, it's the Republic that's under attack," Education Minister Jean-Michel Blanquer tweeted. The killing comes as security forces have been on high alert during the ongoing trial of suspected accomplices of the <em>Charlie Hebdo </em>attacks, which also saw a policewoman gunned down in the street. It also comes just days after a follower of the ISIS group who attacked a police officer with a hammer outside the Notre-Dame cathedral in Paris was sentenced to 28 years in jail. And last month, charges were brought against a 25-year-old Pakistani man after he wounded two people with a meat cleaver to avenge the publication of caricatures of the Prophet Mohammed by <em>Charlie Hebdo</em>, which purportedly prompted the 2015 killings. Seventeen people were killed in the three-day spree that heralded a wave of extremist violence in France that has so far claimed more than 250 lives. In a tweet, <em>Charlie Hebdo</em> expressed its "sense of horror and revolt" at Friday's attack.