The protest movement that formed in response to deadly shootings of African Americans by police won a remarkable series of political victories in the American midwest on Wednesday night, including its first oustings of prosecutors in major cities.



In successive upsets, Democratic primary challengers in Chicago, Illinois, and Cleveland, Ohio, wrested the party’s nomination from sitting prosecutors who came under sharp criticism for their handling of the fatal shootings of Laquan McDonald and Tamir Rice.



The electoral wins were declared just hours after the town of Ferguson, Missouri – where nights of unrest followed the killing of a black 18-year-old by a white officer in August 2014 – buckled under pressure to accept federal oversight of its criminal justice system.



With 96% of votes counted in Cook County, Illinois, challenger Kim Foxx was trouncing the two-term state’s attorney, Anita Alvarez, by almost 30 percentage points. “The stakes in this race were very high,” Foxx, an African American former prosecutor, told a victory rally. “This race is not so much about saying goodbye. It’s about turning the page.”



Alvarez was targeted by demonstrators after the emergence last November of video footage showing Laquan, 17, being shot 13 times by Chicago police officer Jason Van Dyke while walking away from a confrontation in 2014. Despite Alvarez bringing murder charges against Van Dyke, she angered protesters by waiting more than a year to act while city authorities fought to prevent the release of the dashcam recording to the public.



The win by Foxx, who pledged on Wednesday to repair what she called the county’s “broken criminal justice system”, was celebrated by activists who campaigned against Alvarez intensely, some organising on social media under the hashtag #ByeAnita.



Rashad Robinson, the executive director of Color Of Change, said Alvarez’s departure promised to halt “nearly a decade of corruption and over-prosecution in our communities”. In a statement, Assata’s Daughters, a campaign group made up of black women and girls, declared: “Chicago Black youth have kicked Anita Alvarez out of office.”



In Ohio, meanwhile, Cuyahoga County prosecuting attorney Timothy McGinty was unseated by Michael O’Malley, a former deputy county prosecutor. O’Malley, currently the safety director for the city of Parma, led McGinty by almost 10 percentage points with 95% of precincts reporting.



McGinty last year led a contentious and drawn-out grand jury inquiry into the fatal police shooting of Tamir Rice, a 12-year-old African American boy who was playing with a toy gun in a park in November 2014. In December last year, McGinty announced that no charges would be brought against Cleveland police officer Timothy Loehmann, who shot Tamir within seconds of arriving at the scene in response to a 911 call.



Tamir’s family and protesters expressed disgust over the handling of the case by McGinty, who confirmed in December that he had personally recommended to the grand jurors that they not prosecute the officers involved. Throughout the inquiry, McGinty steadily released information that cast the officers in a favourable light, including reports he had commissioned by private consultants that made questionable claims about Rice’s conduct in his final moments.



O’Malley said on Wednesday that he would work to “restore some type of confidence” to the office, according to Cleveland’s Fox 8 News. “I truly believe that over the last three or four weeks people started hearing the message that my campaign team was putting forth, and it was that this county needs to rebuild confidence in the criminal justice system and they need an individual who is willing to work to do that,” O’Malley said.



Earlier in the evening, city councillors in Ferguson had voted unanimously to approve the so-called “consent decree” pushed on them by the US Justice Department following a scathing report that alleged systematic racism in the St Louis suburb’s policing and courts system.



The attorney general, Loretta Lynch, filed a civil rights lawsuit against the town last month, when it initially rejected the oversight deal, raising a series of objections. However, councillors and the mayor voted to accept it under pressure from protesters and after assurances from federal officials over how much the oversight process was likely to cost city funds.



“Our number one goal is to not only move the city but the entire region forward,” Mayor James Knowles said in a statement after the decision. “We have heard the concerns of the community and we’re looking forward to working with our citizens.”



Following the vote, Knowles, a part-time leader lambasted by protesters for more than 18 months, was photographed shaking hands with Michael Brown Sr, whose son Michael was fatally shot in August 2014 following a struggle with white Ferguson officer Darren Wilson. A grand jury declined to bring charges against Wilson, sparking further unrest.

