Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

PARIS — A vehicle plowed into a group of soldiers in a Paris suburb Wednesday in what the local mayor said was "without a doubt" the work of a "terrorist."

A SWAT team tracked, intercepted and shot the suspect five times while he was traveling on a highway around 150 miles north of Paris, officials told NBC News.

The suspect was not killed, and officers detained him and took him to hospital. He is a 36-year-old man, according to a city official.

Patrick Balkany, mayor of Levallois-Perret, identified the suspect as Hamou Benlatreche. Balkany said authorities don't know a motivation in the attack or whether it was directed by an outside group or if he acted alone.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Earlier, French counterterrorism prosecutors opened an investigation after the suspect, driving a BMW, injured six soldiers by ramming them as they left their barracks in the Levallois-Perret region of the city.

The country's Minister of the Armed Forces said three of the wounded soldiers were seriously injured but were not critical.

Balkany told NBC News earlier: "Without a doubt this is a terrorist attack ... he deliberately drove out to hit the soldiers."

He added that he was saddened at the attack, which was recorded on multiple surveillance cameras.

Police gave chase to the vehicle on a motorway north of Paris, and shot and wounded the suspect. Philippe Huguen / AFP - Getty Images

Jean Claude Veillant, who lives in an apartment above the square where the incident occurred, said he heard "a noise and then loud cries" just before 8 a.m. (2 a.m. ET).

"My wife and I we got up and went to the balcony," said the 70-year-old. "There we saw bodies lying on the ground, soldiers were running and some soldiers were trying to help others who looked injured."

The soldiers are part of Operation Sentinel, a large-scale security operation to patrol French towns and cities that was deployed after the Charlie Hebdo attacks of January 2015.

France has been under a state of emergency since the coordinated terror attacks that killed 130 people in November that year.

In recent years, European cities such as London, Berlin, Nice and Stockholm have seen a slew of low-tech attacks where the perpetrators have used vehicles as ramming weapons.

Nancy Ing reported from Paris. Alexander Smith reported from London.

CORRECTION (Aug. 9, 1 p.m.): An earlier version of this article misstated the source of information on the suspect. It was a city official, not the Paris prosecutor's office.