A man in Nice, France, shouted "We have to kill Macron" as he stabbed a priest more than 20 times and injured a nun inside a church on France's election day, which involves President Emmanuel Macron facing far-right candidate Marine Le Pen.

The priest, Father Christophe, 72, survived the attack. He was stabbed in the chest and legs with a knife at Saint-Pierre d'Arene church, according to Reuters.

The man, 31, was taken into custody quickly after the attack. He was described as mentally unstable, with no criminal record by Nice Mayor Christian Estrosi.

"At Saint Pierre d'Arene Church with the Alpes-Maritimes state services, following the stabbing of a priest and a nun. The aggressor, who suffers with mental health problems, was arrested by the National and Local Police,” Estrosi tweeted on Sunday.

A nun was also injured in the arm after trying to intervene and grab the knife from the man, according to French lawmaker Eric Ciotti explained. "Extraordinary courage from Sister Marie-Claude who intervened as the attacker continued to stab Father Christophe," Ciotti said.

French police said there is no suspicion of terrorism. The man reportedly had purchased the knife several days before the attack.

Father Christophe was taken to University Hospital.

“The priest is injured. No vital prognosis involved. Solidarity with the parishioners and thanks to the police who quickly arrested the author,” Interior Minister Gerald Darmanin tweeted on Sunday.