Eric Ciotti

A knife-wielding attacker beheaded a woman and killed two other people in what French authorities believe was a terrorist attack at a church in the city of Nice on Thursday.

City Mayor Christian Estrosi tweeted that the attack had occurred in or near the city's Notre Dame church and that police had detained the attacker, Reuters reports.

Estrosi said the attacker had shouted the phrase "Allahu Akbar," or God is greatest.

One of those killed in the church is believed to be the church warden.

The attacker has been shot and apprehended. He is alive and on his way to hospital, the mayor told reporters.

Tendance Actuelle has published a video of police detaining the attacker.

"Enough is enough," Estrosi said. "It's time now for France to exonerate itself from the laws of peace in order to definitively wipe out Islamo-fascism from our territory."

Police said three people died in the attack and several were injured.

A police source said a woman was decapitated.

The attack comes less than two weeks after history teacher Samuel Paty, 47, was beheaded outside his high school after showing his class caricatures including one of the Prophet Muhammad during a discussion on free speech, according to The Guardian.

After the killing of Paty at Conflans-Sainte-Honorine on 16 October, Macron said France was engaged in an "existential" battle against Islamist fundamentalism.

His comments and support for the publication of controversial caricatures of the Prophet by the satirical newspaper Charlie Hebdo have sparked angry protests across the Muslim world, with pictures of the president burned and calls for a boycott of French goods.