The Tunisian man who killed three people in a French church only recently arrived in Europe, officials say.
The suspect, 21, had an Italian Red Cross document, issued after he arrived on the Italian island of Lampedusa by migrant boat last month.
He was shot by police and is in a critical condition. One of the victims was “virtually beheaded”, said the French chief anti-terrorism prosecutor.
French President Emmanuel Macron said it was an “Islamist terrorist attack”.
Mr Macron said the number of soldiers being deployed to protect public places – such as churches and schools – would rise from 3,000 to 7,000.
Anti-terror prosecutors have opened an investigation, and France has raised its national security alert to the highest level.
The suspect in the Nice attack was heard repeatedly shouting “Allahu Akbar” (God is greatest) before being shot by police.
A Koran, two telephones and a 30cm (12-inch) knife were found on the attacker, said French chief anti-terrorist prosecutor Jean-François Ricard, BBC reported.
Police sources named the attacker as Brahim Aouissaoui.