A female police employee has been fatally stabbed in a knife attack at a police station in Rambouillet, south-west of Paris.
Anti-terror prosecutors have taken over the inquiry, and the killing is being treated as a possible terrorist attack.
The 48-year-old unarmed administrative officer was stabbed in the neck.
The 36-year-old attacker, who reportedly came to France from Tunisia several years ago, was shot and later died in hospital.
The stabbing took place in the secure entrance to the police station on Friday afternoon as the worker was returning from her break at 14:20 (12:20 GMT).
Witnesses said the man had been seen walking around while on his mobile phone outside the police station and he seized his chance to go in as the woman went through the security doors.
He reportedly lunged at the officer, and her colleagues then opened fire on him. Prosecutors said the way the attack had unfolded, as well as remarks made by the attacker and the fact that the victim was a police official had persuaded them to launch an anti-terror investigation.
Sources close to the inquiry told media outlets that the man had shouted “Allahu Akbar” (God is greatest) during the attack.
Officials said the man was residing in France on legitimate papers and was not previously known to security agencies.
French President Emmanuel Macron tweeted that France would never give in to “Islamist terrorism”, naming the murdered woman as Stéphanie.
Prime Minister Jean Castex and Interior Minister Gérald Darmanin went straight to the scene, in the large Yvelines area to the west of the capital.
Mr Castex condemned a “barbaric act of boundless cruelty” and said his first thoughts were with the victims’ family and her colleagues. He paid tribute to the response of police during the attack. “Our determination to combat terrorism in all its forms is as resolute as ever,” he told reporters.
The prime minister said the Yvelines area had been targeted before. Last year a teacher was beheaded in Conflans Saint-Honorine and in 2016 two members of the police force were fatally stabbed at their home.
The militant Islamist murder of teacher Samuel Paty in October 2020 led to national outrage, as he was attacked after an online campaign that began with false claims from a 13-year-old girl at his school.
Far-right leader Marine Le Pen tweeted condemnation of Friday’s attack before details of the suspect’s identity had been made public. “The same horrors come one after another, the same infinite sadness as we think about the relatives and the colleagues of this female police employee who has been killed, the same type of person guilty of this barbarity, the same Islamist motives,” she wrote.