A Tunisian man who stabbed to death a police employee outside Paris on Friday had embraced Islamist extremism in recent months, according to France's anti-terror prosecutor, who said the knifeman watched jihadist propaganda videos just before the attack.
Based on an analysis of the killer's cellphone as well as his social media postings, "his radicalisation appears little in doubt," Jean-Francois Ricard said at a press conference.
The 36-year-old attacker, identified as Jamel Gorchene, stabbed a woman who worked at the police station in Rambouillet, a suburb southwest of Paris, on Friday as she was returning from a break.
Racing into the building's secure entry hall, he grabbed the victim from behind and stabbed her in the stomach and throat while yelling "Allahu Akbar" (God is Greatest), Ricard said.
An officer in the building shot Gorchene after he refused an order to drop the knife, which had a 22-centimetre (nine-inch) blade.
Investigators later discovered that he had watched videos of songs praising jihadist fighters on his phone moments before the attack.
A Koran and a prayer rug were found in his scooter afterwards, Ricard said.
Video surveillance cameras appear to show that Gorchene visited a temporary prayer hall in Rambouillet a few hours before arriving at the station, he added, though the images do not confirm if he entered the building.
Gorchene's father, who was still being held for questioning Sunday, "revealed that his son had adopted a rigorous practice of Islam," Ricard said.
"On the other hand, he also said that he had noticed behavioural troubles since the beginning of this year," he added.
A cousin as well as a couple who housed Gorchene after he arrived illegally in France in 2009 were also still in custody.
Another cousin was detained Sunday, Ricard said, as investigators try to work out what prompted the attack by a man unknown to any of France's intelligence services and without a criminal record.
France has suffered a wave of Islamist terror attacks that have killed more than 250 people in recent years, with Ricard saying the Rambouillet attack was the 17th since 2014.
Gorchene, who obtained a French residency permit last year, had returned last month to Tunisia to visit his family, his first trip to the country since he immigrated.
Ricard said investigators were working with Tunisian authorities, while Tunisia's embassy in Paris said it "strongly condemned" a "barbaric act" carried out during the holy month of Ramadan.
Posts on Gorchene's Facebook page indicate that he might have been spurred to action after the jihadist murder of Samuel Paty, a school teacher, last October, Ricard said.
Paty had angered some students' parents by showing controversial cartoons of the prophet Mohammed printed by the Charlie Hebdo newspaper, whose offices were also targeted in a deadly jihadist attack in 2015.
After the Paty murder, Gorchene embraced "an ideology that legitimises violence against those who offend the prophet", Ricard said.
Algorithms to detect terror threat
Interior Minister Gerald Darmanin said the government would present a new law this week to toughen anti-terror measures, including increased use of computer algorithms to detect potential terror threats among internet users.
"We are now dealing with isolated individuals, increasingly younger and unknown to intelligence services, and often without any links to established Islamist groups," he told the Journal du Dimanche newspaper on Sunday.
President Emmanuel Macron on Saturday visited the police station in Rambouillet as well as the bakery owned by the husband of the victim, a 49-year-old mother of two teenage girls.
The latest bloodshed and violence targeting police are likely to heighten attention on the danger of Islamic extremism in France and on wider concerns about security and immigration a year ahead of presidential elections.
Polls currently indicate that Macron will face a tough race against far-right leader Marine Le Pen, who accused the government of failing to eradicate "Islamism" in the wake of the attack.
But other critics say Macron's efforts to tackle religious extremism, including making it easier for authorities to track foreign funding of mosques, risk stigmatising or alienating French Muslims.