The Strasbourg gunman yelled “Allahu Akbar” (“God is greatest” in Arabic) as he opened fire on people enjoying an evening out at a Christmas market, the Paris public prosecutor told reporters.
Rémy Heitz said two people had been killed and one left brain-dead after the attack in the eastern French city on Tuesday.
Twelve were wounded, six seriously.
The man, named by local media as Chérif Chekatt, was known to authorities as having been radicalised in prison.
The 29-year-old was armed with a gun and a knife and escaped the area in a taxi, Mr Heitz said.
The attacker boasted to the driver – who has spoken to police – that he had killed 10 people, and said he had been injured in a firefight with soldiers.
Four people connected to the suspect had been detained overnight in Strasbourg, Mr Heitz added.
Hundreds of officers are currently involved in the search for the gunman. France’s Deputy Interior Minister Laurent Nuñez earlier acknowledged he may no longer be in France.
Interior Minister Christophe Castaner said the country had moved to a high level of alert, expanding police powers and increasing vigilance.
He added that border controls had been strengthened and security at all Christmas markets would be stepped up.
The mayor of Strasbourg, Roland Ries, has said the Christmas market will be closed on Wednesday and flags lowered to half-mast at the local town hall.
The attack unfolded at around 20:00 local time (19:00 GMT) on Tuesday close to Strasbourg’s famed Christmas market near one of the central squares, Place Kléber, which attracts thousands of visitors at this time of year.
A woman called Audrey told France’s BFM TV how she came face to face with the killer after watching him shoot a man in the head.