The attacker is also dead, officials said.
French anti-terrorist prosecutor Jean-François Ricard said “The way this crime was committed” and “the words said by the attacker during the event” led the anti-terror office to take on the investigation.
The attacker had scouted the location before launching the stabbing, he added.
Witnesses said they heard the attacker shout “Allahu Akhbar,” according to a source close to the investigation.
Police on the scene intervened and “immediately neutralized” the attacker, Prime Minister Jean Castex told journalists on Friday, referring to the incident as a “terrorist attack.”
Castex said that “our determination to fight terrorism in all its shape is unbroken, more than ever.”
Castex and French Interior Minister Gérald Darmanin said they were on their way to Rambouillet, a town of 25,000 people 35 miles southwest of the capital.
“The Republic has just lost one of its heroines, in an infinitely coward barbaric gesture,” he added.
Reacting to the attack, French President Emmanuel Macron said France would not give up the fight against terrorism.
“She was a police officer. Stephanie has been killed in her police station in Rambouillet, on the already wounded land of the Yvelines. The Nation stands by the side of her family, her colleagues, and law enforcement officers. We will not give up the fight against Islamist terrorism,” Macron said on Twitter.
Antonella Francini contributed to this report from Paris.