Soldiers opened fire on a car which tried to ram them twice as they stood guard at a mosque in the south eastern French town of Valence.

The bullets seriously wounded the car's driver in the leg and arm, while a stray shot struck an innocent worshipper, injuring the 72-year-old man in the calf.

A soldier was also slightly injured in the incident, when the car struck his legs.

A photo posted on social media showed one of them being treated at the scene.

Scroll down for video

French soldiers opened fire on a car that was bearing down on them in the town of Valence. Pictured: A man being treated by paramedics at the scene. It is not clear whether he was the driver or another injured person

A photo posted on Twitter showed the Peugeot, which soldiers fired upon, crashed into a ditch near the mosque

The attacker had twice rammed his car - which was registered in Savoie, a department to the east - into the four soldiers guarding the mosque.

The mosque's spokesman Abdallah Imam Dliouah said the driver, who was 'unknown to the mosque', tried to deliberately slam into the four soldiers who were 'responsible for protecting' it.

Mayor Nicolas Daragon told the iTELE news channel that the soldiers, some whom had been thrown to the ground, fired warning shots and one then fired to disable the driver.

'Even if this happened near a mosque, the target was the soldiers,' the mayor added.

Daragon said the attacker's identity, motives and psychiatric state were not yet known.

iTele reported he was not known to the security services or police.

However, journalist Thomas Zimmerman reported that the man was 30, and was originally from Lyon, an hour's drive north.

Photos showed the red Peugeot, whose windows were smashed by bullets, lying in a ditch, its front bonnet crumpled from the collision.

Police set up a cordon around the crash site in the south eastern city, while camouflaged soldiers kept guard

Le Parisien reported that the investigators have yet to identify the driver in Valence because he did not have any documents on him

In another photo shared on Twitter, paramedics surround a man who appears to have wounds on his chest.

It is not known whether the man being treated was the driver, the passenger, the soldier or the worshipper, all of whom were injured in the incident.

In a Facebook statement, Dliouah added: 'They [the soldiers] had to use their firearms, injuring the individual.

'A faithful of the mosque was slightly wounded in the leg by a stray bullet and was rescued by one of the soldiers.

'The officials and the faithful of the mosque of Valencia are deeply shocked by this act.

The car and the soldiers responsible for the protection of the mosque are appreciated by the worshippers.

'We condemn in the strongest terms this aggression against those whose mission is to ensure our safety.

'Despite its gravity, the act will not dampen our resolve to promote the live together, as we have always done.'

The bullets wounded the car's driver and passenger, and a stray shot is said to have struck an innocent worshipper

The soldiers are among thousands protecting sensitive sites around France after the deadly terror attacks which left 130 dead in Paris last month.

Investigators have been unable to identify the driver because he had no documents on him, Le Parisien reported.