A man reportedly killed two people during a stabbing spree outside of Paris Friday before being shot dead by police.
At least two other people were wounded, one of them seriously, a source added.
Ms Beccuau said he had last left hospital in May 2019, and that a month later he stopped taking his medication.
Police union official Yves Lefebvre said officers opened fire repeatedly because they feared the man was wearing an explosive belt and might blow himself up. The rampage was initially investigated by local prosecutors, who said that they uncovered "elements linked to religion" among the suspect's personal belongings, which "suggested he had converted to Islam" recently.
French police are being praised for their swift response to a fatal knife attack in a park in a suburb of Paris.
"An act of terrorism can not be ruled out just because a person has psychiatric problems, but our investigation is still ongoing", French public prosecutor Laure Beccuau told a news conference on Saturday.
In the past four years, the French capital has been rocked by major attacks resulting in mass casualties.
France remains on high alert after being hit by a series of attacks by jihadi extremists since 2015, with more than 250 deaths in total.
The police finally killed the three attackers, but it was the beginning of the wave of attacks on French territory.
The deadliest came in November 2013, when 130 people died in bombings and shootings at Paris's Bataclan concert hall, several bars and restaurants, and the Stade de France sports stadium.
The attack was identified only as Nathan C. and was born in Lilas, a northeastern suburb of Paris, in 1997, the prosecutor's spokesman said.