This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

Please enable Javascript to watch this video

A police officer was ambushed and left in critical condition after being shot while conducting a traffic stop in western St. Louis County Friday, and the suspected gunman was taken into custody, authorities said.

The shooting occurred in Ballwin, a city of about 30,000, according to KTLA sister station KTVI in St. Louis.

The officer was returning to his vehicle to do followup paperwork after pulling another car over when the driver got out, "advanced quickly," and fired three shots, Ballwin Police Department Chief Kevin B. Scott said.

The nine-year veteran officer was hospitalized and was in critical but stable condition, Scott said.

The suspect was taken into custody after he fled in his vehicle and then on foot.

He was later identified as Antonio Taylor, 31, of St. Louis, KTVI reported. He was charged with first-degree assault of a law enforcement officer, armed criminal action, and being a felon in possession of a weapon.

There was a large multi-agency response to the shooting, Scott said.

The shooting came a day after five officers were killed when sniper fire struck a police working a protest in downtown Dallas over the recent killings of two black men by police in Minnesota and Louisiana.

"Sad day for law enforcement, indeed," St. Louis County Police Chief Jon Belmar said at a news conference with Scott.

The St. Louis Post-Dispatch reported the officer was shot in the neck and was in critical condition.

"Make no mistake, we believe ... that Ballwin officer was ambushed. Period," Belmar said. "It is an unfortunate state of events."

Investigators do not know the shooter's motive.

The shooter was taken into custody several miles from the scene of the shooting after fleeing in his vehicle and then on foot, Belmar said. An officer took the individual into custody without incident, he said.

A handgun was recovered, Belmar said.

The suspected shooter is on probation for a weapons violation in St. Louis, Belmar said.

He stole a vehicle in Oklahoma and was picked up with a firearm in California, the county chief said. He was paroled last year.

Oklahoma records indicate Antonio Taylor served two years and two months for robbery and unauthorized use of a vehicle. He was released in January 2009.

Taylor had a tattoo on each arm, according to Oklahoma corrections data. The tattoos read "life is God" and "God I trust."

Police say Antonio Taylor, 31, shot a Ballwin police officer in the neck Friday morning pic.twitter.com/Ql0HGyQVCv — FOX2now (@FOX2now) July 8, 2016

This release was handed out to media at the news conference regarding the Ballwin Police shooting. pic.twitter.com/acDyaE7agb — FOX2now (@FOX2now) July 8, 2016

Sources tell us a Ballwin officer was shot in neck during traffic stop. Suspect in custody after foot chase. Story TK @stltoday — Christine Byers (@ChristineDByers) July 8, 2016

Police presence growing outside Mercy Hospital emergency room after reports a police officer was shot in Ballwin, MO pic.twitter.com/su3ruIIZr4 — Mike Colombo (@Mike_Colombo) July 8, 2016

Man believed to wounded police officer just arrived via ambulance to Mercy Hospital. Taken on stretcher into ER. pic.twitter.com/y446dTrO3n — Mike Colombo (@Mike_Colombo) July 8, 2016

Police presence continues to grow outside Mercy Hospital when wounded Ballwin officer was taken. pic.twitter.com/DTFdzoa1Gh — Mike Colombo (@Mike_Colombo) July 8, 2016

38.595053 -90.546234