The Strasbourg gunman yelled “Allahu Akbar” 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. – READ MORE