Two police officers have been shot during a protest outside a police station in the US city of Ferguson, Missouri, witnesses said.

The shooting occurred early on Thursday morning after several dozen protesters had gathered in front of the Ferguson police department, just hours after the city's police chief, Thomas Jackson, announced his resignation.

A few dozen demonstrators fled following the sound of gunfire around midnight with some screaming, "They hit a cop," according to a Reuters photographer at the scene.

Police could not be reached immediately for comment. 

Protesters had called for Jackson's removal since the fatal shooting of unarmed black teenager Michael Brown by white Ferguson police officer Darren Wilson on August 9, 2014.

The killing triggered nationwide protests and drew scrutiny to police use of deadly force, especially against black men.

Jackson's departure was the latest in a string of officials who stepped down following a scathing report from the US Justice Department that found widespread racially biased abuses in the city's police department and municipal court.

The St Louis Post Dispatch quoted a police source as saying one of the officers is a St Louis Country officer and the other a Webster Groves officer.

The officers - one shot in the face and the other in the shoulder - were taken to Barnes-Jewish Hospital, where there was a large number of police vehicles.

The source said the injuries are not life-threatening.  

About 25 protesters remained at the scene about two hours after the shooting. Police wouldn't let them leave until they gave statements, the paper reported.