Patrice Peyroqueou, a police official, said that the suspect fled in his auto after throwing an incendiary device into the mosque, before police apprehended him at his house.
Police arrested the man at his house in the Landes, a department in southwestern France, it added.
A source close to the investigation identified the man as Claude Sinke, and said he had admitted to being the shooter. "The two people came out, he shot at them, hitting one in the neck and the other in the chest and arm".
The Hijab or Muslim veil is a hot topic in France after far-right politicians from the National Party openly attacked a Muslim woman in a meeting on October 14 for wearing the hijab.
Former candidate for Le Pen's party? .
Sinke stood as a candidate for Marine' le Pen's National Front in 2015 regional elections, according to the official list.
France's Interior Minister Christophe Castaner tweeted, "The suspected assailant was arrested by national police".
French President Emmanuel Macron condemned the "odious attack" in a tweet and vowed to "do everything" to punish attackers "and protect our Muslim compatriots".
There have been intermittent attacks on mosques in France in recent years.
"The attack on #Bayonne's mosque is an unspeakable act that is absolutely contrary to all the values of our movement", she wrote in a Twitter post. In March this year, workers building a mosque in the south-western town of Bergerac found a pig's head and animal blood at the entrance to the site.
Mosques were also targeted after the killing of 12 people at the Charlie Hebdo satirical magazine in 2015 by Islamist radicals.