The 49-year-old mother-of-two was fatally stabbed in the neck at the entrance to a police station in Rambouillet, a middle-class commuter town outside Paris.
She was returning from her break shortly after midday when the man entered the police station, according to local reports.
The 36-year-old assailant lunged at the officer, who had worked for the police since 1993, and her colleagues then opened fire on him and he was shot dead.
President Emmanuel Macron that France would never give in to “Islamist terrorism” after the fatal stabbing, AFP reported.
Prime Minister Jean Castex said: "France has lost one of its everyday heroines in a barbaric gesture of infinite cowardice.
“To her relatives, I offer my support on behalf of the entire nation. To our security forces, I want to tell them I share their emotion and their indignation.”
Local MP Aurore Bergé, said: “Whenever our law enforcement agencies are attacked, it is France that is attacked. Rambouillet is a town that is not at all used to being subjected to violence.
“This reminds us that our law enforcement agencies put their lives at risk every morning when they go to work.”
The attacker was of Tunisian nationality and residing in France on legitimate papers.
He is said to have arrived in the country in 2009.
He was not previously known to police or anti-terrorist authorities and had recently moved to Rambouillet after living in the Val-de-Marne.
According to some media reports, the knifeman shouted Allahu Akbar, however a security official has denied this.
The Versailles prosecutor is currently investigating.
The French anti-terror police have also opened an investigation.
The incident follows the fatal stabbing of four people in the headquarters of the Paris police force in 2019.
In October last year teacher Samuel Paty was beheaded after showing students cartoons of the Prophet Muhammad at his school in Conflans-Sainte-Honorine, west of Paris.