France stepped up security nationwide on Friday to guard against Islamist attacks after the fatal stabbings at a church in Nice, while protests flared in parts of the Middle East, Asia and Africa over French caricatures of Prophet Mohammad.
President Emmanuel Macron deployed thousands of soldiers to protect sites including places of worship and schools, and the nation was at its highest level of security alert after the second deadly knife attack in its cities in two weeks.
Macron has called the deadly stabbing an "Islamist terrorist attack" and announced increased surveillance of churches by France's Sentinelle military patrols, to be bolstered to 7,000 troops from 3,000.
Security at schools would also be boosted, he said.
"Quite clearly, it is France that is being attacked," the president added, vowing the country "will not give up on our values."
Police were holding a 21-year-old Tunisian migrant, identified by a French police source and Tunisian officials as Brahim al-Aouissaoui, over the attack in which a man shouting "Allahu Akbar" (God is Greatest) decapitated a woman and killed two other people in Notre Dame Basilica in Nice on Thursday.
The attack took place at a time of growing anger among Muslims in many countries over the issue of French cartoons of Prophet Mohammad, which they deem insulting and blasphemous.
It occurred almost two weeks after Samuel Paty, a school teacher in a Paris suburb, was beheaded by an 18-year-old Chechen. Paty had shown his pupils such cartoons in a class on freedom of expression.
France, home to Europe's largest Muslim community and hit by a string of militant attacks in recent years, has defended the right to publish such cartoons. Macron has insisted France will not compromise on its basic freedoms of belief and expression.
In Pakistan, Bangladesh and the Palestinian territories, tens of thousands of Muslims staged anti-French protests after Friday prayers.
In Islamabad, police briefly fired tear gas at protesters who broke through security blockades in a failed attempt to demonstrate at the French embassy.
In Bangladesh, marchers in the capital Dhaka chanted "Boycott French products" and carried banners calling Macron "the world's biggest terrorist." Some burned effigies of the French president.
"Macron is leading Islamophobia," said Dhaka demonstrator Akramul Haq. "The Muslim world will not let this go in vain. We'll rise and stand in solidarity against him."
Protests also took place in India, Lebanon and Somalia.
The leader of Lebanon's Hezbollah movement, Sayyed Hassan Nasrallah, said the cartoons were an aggression. He condemned the Nice stabbings, but said Western leaders also bore responsibility for such crimes because of their roles in Middle East conflicts.
Interior Minister Gerald Damarnin said France was engaged in a war against Islamist ideology and more attacks on its soil were likely. "We are in a war against an enemy that is both inside and outside," he told RTL radio.
Nice Police chief Richard Gianotti said any symbol of the republic or Christianity was a potential target. "We have to be vigilant, we have to be attentive," he told Reuters.
French embassies were also told to step up security.
Police used a Taser and rubber bullets to overpower a man in Paris on Friday when he threatened officers with two knives after they challenged him. The motive was not immediately clear.
In Nice, residents mourned the victims of what was the second attack in the Mediterranean city in recent years. In July 2016, a militant drove a truck through a seafront crowd celebrating Bastille Day, killing 86 people.
People gathered in front of the Notre Dame church to lay flowers and light candles.
"I'm from Nice and this is a tragedy once again," said Frederic Lefevre, 50, who wore a French national rugby shirt.
"We're a free country. Let's love freedom – that's a message to the world. No god should kill," he said.
(With input from agencies)