But the incident, which took place last evening in the town of Valence, was not being treated as terror-related due to insufficient evidence, prosecutor Alex Perrin told reporters.
"The terrorism line of investigation has been ruled out for now," he said.
The 29-year-old suspect, a French citizen of Tunisian origin, had told investigators "he wanted to be killed by the soldiers and kill the soldiers", the prosecutor said.
"This appears to be someone who acted alone and had no particular link to any movement," Perrin said.
More From This Section
Witnesses said the driver deliberately accelerated his Peugeot car as he headed towards a group of four soldiers in a car park outside a large mosque in a suburb of Valence.
The driver bore down on the team a first time, prompting them to shout a warning, and when he returned for a second pass, they opened fire, injuring him in the arm and the leg.
One of the soldiers sustained leg injuries after being hit by the vehicle, and a 72-year-old worshipper was also hurt after being hit in the leg by a stray bullet.
More than 10,000 soldiers are deployed across France to guard premises including mosques and synagogues.