Two men in their seventies were seriously injured on Monday when a man opened fire at a mosque in the southern French city of Bayonne, local authorities said.
The attacker tried to set the door of the mosque on fire, but was surprised by the two victims, authorities said. He shot them, then set alight a vehicle while leaving the scene.
The attacker was arrested shortly afterwards at his home, the Pyrenees-Atlantiques prefecture said in a statement posted on social media.
A police source said the man arrested was in his 80s.
The attack came amid renewed controversy in France over Islam and, especially, the wearing of headscarves by some observant Muslim women.
The attack "moves and angers every one of us," Interior Minister Christophe Castaner wrote on Twitter. "Solidarity and support to the Muslim community, who are understandably shocked and alarmed," the minister added.
Hours earlier, French President Emmanuel Macron met leaders of the official body representing Islam in France. Anouar Kbibech of the French Council of the Muslim Religion (CFCM) said the president had "reassured us" that French Muslims should be able to "live their religion."
Macron had also told the group that he "counted on us to take strong initiatives" on topics including extremism, the veil, and the place of women in Islam, Kbibech told reporters afterwards.
The current debate was sparked by a far-right politician who demanded that a mother accompanying a school trip to the public gallery of a regional assembly be ordered to take off her headscarf. Muslims make up France's largest religious minority, with most of them tracing their origins to former French colonies in North Africa.
Related Story