One officer was shot in the face and one in the shoulder, St Louis County police chief Jon Belmar said.
Both suffered “very serious gunshot injuries” but were conscious, he said.
They were shot during a demonstration after the resignation of Ferguson’s police chief, which followed a report alleging racial bias in his department.
Protesters had gathered outside Ferguson police headquarters late on Wednesday, in what was initially a relatively low-key demonstration.
But shortly after midnight at least three shots were fired as the crowd of protesters was starting to break up, Mr Belmar said.
He said he was assuming that “these shots were directed exactly at my police officers”, rather than the officers being hit by stray bullets.
Several witnesses said the shots had come from a hill on the other side of the street from the crowd of protesters.
One protester, Keith Rose, said he saw an officer “covered in blood”, and that other officers were carrying and dragging him, leaving a trail of blood on the ground.
Demonstrators were calling for further action to be taken over the federal report, and for more resignations in the police department, Mr Rose said.
Police chief Thomas Jackson was the sixth Ferguson official to be fired or step down. He had initially resisted calls from protesters and some state leaders to resign.
Mr Jackson was widely criticised after the shooting of 18-year-old Michael Brown in August and the weeks of demonstrations that followed.
9 August, 2014: White police officer Darren Wilson shoots dead unarmed black teenager Michael Brown
15 August: Authorities identify Mr Wilson, following days of protests and clashes with police
10-13 October: Activists from across US hold four days of rallies and vigils in Ferguson
24 November: Grand jury decides not to charge Mr Wilson, triggering further demonstrations
4 March: Department of Justice issues report alleging widespread racial bias in Ferguson police department
25 March: Police chief Thomas Jackson announces his resignation
Brown’s killing was one of a several recent cases in which the deaths at the hands of the police of unarmed people from minorities – and subsequent decisions not to prosecute officers – have triggered protests.
In November, a St Louis County grand jury found that white police officer Darren Wilson did not break any laws when he shot Brown.
However, Brown’s shooting and the riots that followed spurred a federal investigation. It found overwhelming racial bias in the town’s policing practices, though Darren Wilson was cleared of civil rights violations.
The report noted public officials regularly made tickets and other minor violations “go away” for white friends, while some black residents spent nights in jail for non-payment of fines.
It also found that black residents were disproportionately subjected to baseless traffic stops and citations for minor infractions such as walking down the middle of the street.
Ferguson’s police force had three black officers, despite the fact that the town of 21,000 people was predominantly black.
In a speech to mark the 50th anniversary of the Selma civil rights march in Alabama last weekend, US President Barack Obama called the narrative of the report on Ferguson “woefully familiar”.
Attorney General Eric Holder has said the federal government will “use all power that we have to change the situation”.
A local Democratic party leader, Patricia Bynes, said “a lot of anger” had built up in Ferguson because more action had not been taken sooner.
The names of the two officers wounded on Thursday were not given, but Mr Belmar said one was a 32-year-old from a police department in another St Louis suburb, Webster Groves, and the other a 41-year-old from St Louis County police department.