An elderly man suspected of firing shots outside a mosque in the south-western city of Bayonne has been arrested, French police say.
The gunman was trying to set fire to the mosque's door and shot two men, both in their 70s, who surprised him, police said.
They were both seriously injured in the incident, which happened at 15:20 (14:20 GMT), and taken to hospital.
An 84-year-old man was later arrested near his home close to Bayonne.
As he left the scene, the gunman also tried to set fire to a car, police said in a statement (in French).
French President Emmanuel Macron has strongly condemned what he described as an "odious" attack on the mosque.
"The Republic will never tolerate hatred," he said. "Everything will be done to punish the perpetrators and protect our compatriots of the Muslim faith."