French police have arrested an elderly man suspected of firing shots at a mosque in the south-west of France on Monday.

Two people, aged 74 and 78, were seriously injured in the shooting at 2.20pm, local time, as they tried to prevent the attacker from setting fire to the mosque in Bayonne, about 10 kilometres east of Biarritz.

The shooter also allegedly set a car on fire while fleeing the area.

"The suspected assailant was arrested by national police ... my thoughts are with the victims and their family," Interior Minister Christophe Castaner said on his Twitter account.

A police source said that the 84-year-old suspect had far-right connections. A separate source familiar with the situation said the man had been a candidate for Marine Le Pen's National Rally party in 2015.