Three people were murdered in another knife attack in Nice
French President Emmanuel Macron said w it was "an Islamist terrorist attack".
He said France would not surrender its core values after visiting the Notre-Dame basilica in the southern city. An extra 7,000 troops are being deployed to protect churches and schools.
In Nice, one elderly victim was beheaded", officials said. Another woman and a man also died.
French anti-terrorist prosecutor Jean-François Ricard later said the attacker was seriously wounded by police.
Mr Ricard said the suspect was a 21-year-old Tunisian national who had arrived in France earlier this month. He had a document issued by the Italian Red Cross.
Police sources earlier named the attacker as Brahim Aioussaoi. They said he had travelled by boat from Tunisia to the Italian island of Lampedusa in September. He was placed in coronavirus quarantine there before being released and told to leave Italy.
Nice Mayor Christian Estrosi spoke of "Islamo-fascism" and said the suspect had "repeated endlessly 'Allahu Akbar' (God is greatest)".