Associated Press

ST. LOUIS — A St. Louis police sergeant was hospitalized in critical condition but expected to survive after being shot Sunday night in what the police chief called an "ambush."

Police Chief Sam Dotson said the 46-year-old officer was shot twice in the face. The suspect got away and a massive search was underway.

Police investigate a scene after a St. Louis police officer was shot in what the police chief called an "ambush" on Sunday, Nov. 20, 2016, in St. Louis. (David Carson/St. Louis Post-Dispatch via AP)

"Fortunately for the blessing of God the officer's going to survive," Dotson said during a brief news conference after the shooting. He declined to name the officer but said he is a married father of three who has been with the department for about 20 years.

Suspect drove alongside officer's marked police vehicle & fired shots into the vehicle, striking the officer. Suspect fled and is at large. — St. Louis, MO Police (@SLMPD) November 21, 2016

The officer was not involved in a call or a traffic stop but was sitting in traffic about 7:30 p.m. Sunday when another car pulled up alongside his marked police vehicle. The officer told police he heard at least two shots.

"This officer was driving down the road and was ambushed by an individual who pointed a gun at him from inside of his car and shot out the police officer's window," Dotson said.

Mayor Francis Slay said the officer did nothing to provoke an attack.

"He didn't deserve this," Slay said. "It looks like he's going to survive. He's going to be OK. But this is traumatic. It's traumatic for him, his family. It's traumatic for the city of St. Louis. He was just doing his job."

Police were looking for a silver car, which was all the description the wounded officer could recall. Helicopters, SWAT teams and scores of officers searched the south St. Louis neighborhood where the shooting occurred. Police were also looking for any surveillance video that may have captured the shooting.

The attack in St. Louis came on the same day a San Antonio detective was fatally shot in his squad car while writing a traffic ticket by someone who pulled up from behind. Detective Benjamin Marconi, 50, was a 20-year veteran of the San Antonio department.

In July, a gunman in Dallas killed five officers who were working a protest about the fatal police shootings of black men in Minnesota and Louisiana. Ten days later, a man killed three officers in Baton Rouge, Louisiana. And earlier this month, two Des Moines, Iowa-area officers were fatally shot in separate ambush-style attacks while sitting in their patrol cars.

In the St. Louis area, Ballwin, Missouri, officer Mike Flamion was paralyzed from the neck down after being shot during a traffic stop in July. And St. Louis County officer Blake Snyder was fatally shot while responding to a disturbance call in October.

"This just shows the dangers of policing, not only here in St. Louis but around the country," Dotson said.

LIVE on #Periscope: Chief & Mayor brief media on injured officer https://t.co/2wZiziY2UW — St. Louis, MO Police (@SLMPD) November 21, 2016