An off-duty St. Louis police officer shot and killed a black 18-year-old who had fired at him, authorities said Thursday. The killing led to an angry demonstration, with some protesters likening it to the August killing of an unarmed black 18-year-old by a white officer in nearby Ferguson, Mo.

Hours after the shooting, a crowd gathered at the scene near the Missouri Botanical Garden. Some shouted "Hands up, don't shoot" in reference to the fatal shooting in August of an unarmed 18-year-old African-American, Michael Brown, by a white police officer in nearby Ferguson. That shooting led to weeks of sometimes violent unrest in the St. Louis suburb. The officer, Darren Wilson, has not been charged in the shooting.

St. Louis Police Chief Col. Sam Dotson said the 32-year-old officer, whom he didn't identify, was patrolling the historic Shaw neighbourhood in his police uniform for a private security company at around 7:30 p.m. local time Wednesday when he saw three males, and one of them ran off before stopping.

When the officer turned his vehicle around, all three ran, so the officer gave chase, first in his car and then by foot. During the chase, he got into a physical altercation with the one he eventually killed, Dotson said at an early-morning news conference.

Dotson said that at one point, the suspect's shirt raised and the officer saw what he thought was a gun. "The officer said he wanted to be certain it was a gun and did not fire at that point," he said.

The chief said the suspect, whom he didn't identify, ran up a hill, turned and opened fire on the officer, who returned fire and killed the man. Ballistic evidence shows that the teen fired three shots and tried to fire again but his gun jammed, he said, noting that the 9-mm gun was recovered.

The officer, a six-year veteran of the St. Louis police force whose race wasn't immediately known, fired off 17 rounds. Dotson said he didn't know how many of those bullets struck the suspect, or why the officer, who wasn't hurt, fired that many shots.

People who described themselves as relatives of the man who was killed told The St. Louis Post Dispatch that he was not armed.