The motive of the suspect, who local media said was 84, was not immediately known. President Emmanuel Macron condemned the "odious attack" in a tweet and vowed to "do everything" to punish attackers "and protect our Muslim compatriots."
France "will never tolerate hate," he said. The man wrote days ago to the region's prosecutor saying he wanted to file a complaint against Macron, according to the Sud Ouest newspaper which received a copy of the letter.
The paper printed only the top of the missive, dated Oct. 25, because of its "discriminatory, xenophobic and defamatory character." His complaint against the centrist president was not immediately clear. The letter made no mention of any intention to attack the mosque, the paper said.
The newspaper identified the suspect as Claude Sinke, a candidate in 2015 departmental elections for France's far-right National Rally party, then known as the National Front. Interior Ministry election results from 2015 show that a Claude Sinke ran unsuccessfully in his community of Seignanx.
The National Rally acknowledged that the suspect had been a candidate in the 2015 elections before being kicked out of the local federation for speaking in a way "deemed contrary to the spirit and the political line" of the anti-immigration party.
The incident came amid a divisive debate in France over the headscarves worn by some Muslim women and whether the nation's secular principles were being honored. It drew quick condemnation. Interior Minister Christophe Castaner, who is in charge of the nation's religions, called for "solidarity and support for the Muslim community."
National Rally leader Marine Le Pen distanced her party from the incident. The party regularly evokes fears of Islam conquering French civilization. "These crimes must be treated with the most total severity," she tweeted.
On the far-left, Jean-Luc Melenchon tweeted that "harassment of Muslims has produced an effect .... That's enough now!"