French President Emmanuel Macron condemned a "heinous" attack on a mosque in the southern city of Bayonne on Monday.
A former ultra-right party candidate, who is aged in his eighties, shot and wounded two people and tried to burn the building.
It is thought the two injured men were shot at when they found a man trying to set fire to the mosque's door.
A man was later arrested by police near his home in Saint-Martin de Seignanx, 16 kilometres north of Bayonne.
A gun and a gas canister were found in his car.
"The Republic will never tolerate hatred," the president tweeted. "Everything will be done to punish the perpetrators and protect our Muslim compatriots. I commit myself to it."
The victims, aged 74 and 78, were being treated in hospital.