The officer, 39, was struck in the torso but was saved by his bullet-proof vest, St Louis police chief Sam Dotson said.
“What we have is a sergeant of the St Louis police department, working in full uniform, who was ambushed, who was targeted,” Dotson said.
The attack comes nearly a year after the police shooting of unarmed black man Michael Brown in the St Louis suburb of Ferguson led to inflamed racial tensions across the region.
In December, two officers were shot and killed in New York by a man who said he wanted to kill police because he was angry about the deaths of Brown and another man, Eric Garner, who died after being put in a chokehold as he was arrested for selling cigarettes.
In Tuesday’s shooting, the off-duty officer — who is black — was sitting in his own car shortly before 5:00 am while working an approved second job as a security guard in a posh neighborhood filled with shops and restaurants.
A car pulled up in front of him and a young black man with a bandana over his face out got out and started shooting.
The officer — a 16-year veteran — returned fire from his car and believes he may have hit the assailant, Dotson said.
Three other black men were in the vehicle, which sped away after the officer got out of his car.
A lone protester holding a sign reading “How Does It Feel?” went to the scene of the shooting and stood with his back to the yellow police tape.
“How does it feel to be met with same aggression you inflict on certain communities daily?” Dhoruba Shakur, 25, told the St Louis Post Dispatch.
The officer — who was able to chase after the gunman but lost him in a parking garage — was treated in hospital for minor injuries and released Tuesday morning.