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. Sources close to the investigation quoted by Reuters news agency said they were the suspect's mother, father and two brothers.
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…