Three people have died in a knife attack at a church in Nice, in what French President Emmanuel Macron said 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 4,000 troops are being deployed to protect churches and schools.
In Nice, one elderly victim was "virtually beheaded", officials said. Another woman and a man also died.
A male suspect was shot and detained.
Anti-terror prosecutors have opened an investigation into the attack and France has raised its national security alert to its highest level.
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)".
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.
Speaking after visiting Nice, President 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."
The president said the number of soldiers being deployed to protect public places across the country would rise from 3,000 to 7,000.
Mr Estrosi compared the attack to the recent murder of teacher Samuel Paty, who was beheaded close to his school outside Paris earlier this month.
Police have not suggested a motive for the attack in Nice. However, it follows days of protests in some Muslim-majority countries triggered by President Macron's defence of the publication of cartoons that depicted the Prophet Mohammed. There have been calls in some countries for a boycott of French goods.
Who were the victims?
All three were attacked inside the basilica on Thursday morning before the first Mass of the day.
Two died inside the church: a 60-year-old woman who was "virtually beheaded", and a 55-year-old man whose throat was cut.
The male victim was a lay member of staff responsible for the upkeep of the church. He reportedly had a wife and two children.
Another woman, aged 44, managed to flee to a nearby cafe after being stabbed several times, but died later.
It later emerged that a witness had managed to raise the alarm with a special protection system set up by the city.
Chloe, a witness who lives near the church, told the BBC: "We heard many people shouting in the street. We saw from the window that there were many, many policemen coming, and gunshots, many gunshots."
Tom Vannier, a journalism student who arrived at the scene just after the attack, told the BBC that people were crying on the street.
Four police officers arrived at the scene at 08:57 local time (07:57 GMT) and the attacker was shot and detained shortly afterwards, the French anti-terrorist prosecutor said.
Four years ago Nice was the scene of terrorist attack, when a Tunisian drove a truck into crowds celebrating Bastille Day on 14 July, killing 86 people.
Disorientated and frightened
The terrorist threat level in France is as high now as it was in 2015-16, the terrible days of Charlie Hebdo, Bataclan, the Nice lorry-killer and the murder of Father Hamel in his church in Rouen. Things were bad enough then - and many more people died in those attacks. So why does this outbreak of Islamist violence feel somehow more scary?
One reason must be the symbolism of the Samuel Paty beheading. That a simple history teacher could be murdered - and not randomly but actually selected for murder - has been deeply unsettling for French people. Likewise the targeting today of Christian worshippers in Nice.
But it is also the context: the instant logic of action-response that followed President Macron's robust defence of secularism at Samuel Paty's memorial 10 days ago. All it took was a speech, then there were the threats, then there were the deaths.
With a new Covid lockdown providing an eerie backdrop to these events, small wonder the French are feeling disoriented and frightened.
What has the reaction been?
A minute's silence was held in the National Assembly.
The French Council of the Muslim Faith condemned the attack and spoke of its solidarity with the victims and their families.
Turkey, which has seen ties with France sour in recent days over remarks by Mr Macron, strongly condemned the "savage" attack.
Vatican spokesman Matteo Bruni said the killings had "brought death to a place of love and consolation".
What's the context?
Thursday's attack has 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 and the government's attempt to crack down on what Mr Macron described as "Islamist separatism" has angered Turkey and other countries.
Turkish President Recep Tayyip Erdogan was among those calling for a boycott of French goods.
The situation worsened after a cartoon on Mr Erdogan appeared in the satirical magazine Charlie Hebdo.
A timeline of recent attacks in France
October 2020: French teacher Samuel Paty is beheaded outside a school in a suburb of Paris
September 2020: Two people are stabbed and seriously hurt in Paris near the former offices of Charlie Hebdo, where Islamist militants carried out a deadly attack in 2015
October 2019: Radicalised police computer operator Mickaël Harpon is shot dead after stabbing to death three officers and a civilian worker at Paris police headquarters
July 2016: Two attackers kill a priest, Jacques Hamel, and seriously wound another hostage after storming a church in a suburb of Rouen in northern France
July 2016: A gunman drives a large lorry into a crowd celebrating Bastille Day in Nice, killing 86 people in an attack claimed by the Islamic State (IS) group
November 2015: Gunmen and suicide bombers launch multiple co-ordinated attacks on the Bataclan concert hall, a major stadium, restaurants and bars in Paris, leaving 130 people dead and hundreds wounded
January 2015: Two Islamist militant gunmen force their way into Charlie Hebdo's offices and shoot dead 12 people