The man who stabbed two women and a man to death at a church in France arrived from Tunisia days ago, officials say.
The suspect, 21, had an Italian Red Cross document issued after he arrived on a migrant boat to Italy’s Lampedusa island last month. He was shot by police and is in a critical condition.
One of the victims of Thursday’s attack at the Notre-Dame basilica in the city of Nice was “virtually beheaded”.
President Emmanuel Macron said it was an “Islamist terrorist attack”.
The stabbings have echoes of another attack earlier this month near a school north-west of Paris. Samuel Paty, who was a teacher in Conflans-Sainte-Honorine, was beheaded days after showing controversial cartoons of the Prophet Muhammad to some of his pupils.
The murder has heightened tensions in France. Mr Macron’s defence of the right to publish the cartoons and the government’s attempts to crack down on radical Islam have angered Turkey and other Muslim-majority countries.
The suspect was heard repeatedly shouting “Allahu Akbar” (God is greatest) before being shot by police on Thursday morning.
Police sources named him as Brahim Aioussaoi.
Anti-terror prosecutors have opened an investigation, and France has raised its national security alert to its highest level.
Speaking after visiting Nice, Mr Macron said: “If we are attacked once again it is for the values which are ours: freedom, for the possibility on our soil to believe freely and not to give in to any spirit of terror.
“I say it with great clarity once again today: we won’t surrender anything.”
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.
Two other attacks took place on Thursday, one in France and one in Saudi Arabia.
A man was shot dead in Montfavet near the southern French city of Avignon after threatening police with a handgun.
A guard was attacked outside the French consulate in Jeddah in Saudi Arabia. A suspect was arrested and the guard taken to hospital.