A female police employee has been fatally stabbed in a knife attack at a police station in Rambouillet, south-west of Paris.
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.
Anti-terror prosecutors have taken over the inquiry, and the killing is being treated as a possible terrorist attack.
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 seized his chance to go in as the woman went through the security doors.
He lunged at the officer and her colleagues then opened fire on him.
Prime Minister Jean Castex and Interior Minister Gérald Darmanin went straight to the scene, in the large Yvelines area to the the west of the capital.
“The republic has lost one of its everyday heroes in a barbaric act of unlimited cowardice,” Mr Castex tweeted.
Police appealed to the public not to share rumours. Officials said the man was unknown to intelligence service.
The attack has revived memories of earlier attacks in the Yvelines area. Five years ago, two police officers were fatally stabbed at their home, and last year a teacher was beheaded near his school in Conflans Saint-Honorine, north-west of Paris.
A 2019 attack at Paris police headquarters left three officers dead. The attacker was a police computer operator.