The attacker, a former soldier, shot at people inside the mosque while they were praying, injuring two elderly men, who were taken to the hospital with serious injuries, according to French newspaper Sud Ouest.
The shooter, who has not been identified so far, was arrested at his home around 10 kilometers away in Saint-Martin-de-Seignanx after fleeing the scene by car.
Police found a gun and grenades at the address, according to local reports.
The man had connections with the far right and ran in local elections a few years ago for Marine Le Pen’s National Front Party, which has since been renamed National Rally, media reports also said, quoting police sources.
French President Emmanuel Macron condemned the “odious attack” on Twitter, saying his thoughts are with the victims.
“The Republic will never tolerate hatred,” Macron said.
“Everything will be done to punish the perpetrators and protect our compatriots of the Muslim faith,” he added.
An investigation into the incident continues.