CHICAGO — Voters in the Chicago area on Tuesday voted out incumbent Cook County State’s Attorney Anita Alvarez, marking the downfall of the two-term prosecutor who was at the center of controversy following the release of disturbing video showing the police shooting death of 17-year-old Laquan McDonald.

Kim Foxx, a former assistant prosecutor whose candidacy received the backing of several prominent African-American politicians in the nation’s third-largest city, defeated Alvarez and former federal prosecutor Donna More for Democratic nomination and will face Republican candidate Christopher Pfannkuche in the November election.

“The work is just beginning, and our struggles here are very real,” Foxx told supporters in a victory speech Tuesday

Alvarez, who was the first Hispanic and woman to hold the office, had faced deep scrutiny since the court-ordered release nearly four months ago of the 2014 shooting that showed a white Chicago Police officer, Jason Van Dyke, pump 16 shots into the body of McDonald, who was African-American.

Alvarez announced first-degree murder charges against Van Dyke on the same day the video was released.

But because her office took 400 days to announce the charges and resisted public release of the video, there was widespread outrage in the African-American community. Protesters, who took to the streets for near-daily protests in the week after video’s release, called for her resignation as well as that of Mayor Rahm Emanuel.

Both refused and Alvarez promised to continue her fight. But the incident sparked a U.S. Justice Department civil rights investigation of the Chicago Police Department. Emanuel also decided to oust his police superintendent Garry McCarthy.

The presence of McDonald, who had been in and out foster care and suffered from mental health issues, loomed large during this political season in Chicago. Foxx used a portion of the dashcam video in an attack ad against Alvarez. Yard signs expressing love for McDonald dotted lawns and fields alongside signage promoting political candidates in the city’s predominantly African-American neighborhoods on the city’s West and South Sides.

Last month, a coalition of politicians and activists petitioned the Cook County Circuity Court to appoint a special prosecutor to take over the case against Van Dyke. The call to replace Alvarez was backed by Rep. Danny Davis, Rep. Bobby Rush, and Cook County Board President Toni Preckwinkle. All three of the Democratic politicians also backed Foxx’s candidacy.

The petitioners also charged that Alvarez has a long track record of being soft on cops.

She declined to prosecute an officer who allegedly lied under oath in 2011 in an attempt to boost evidence against a man accused of shooting a liquor store owner in a robbery. Alvarez has also faced criticism for the prosecution of Chicago Police officer Dante Servin, who was found not guilty last year of involuntary manslaughter for the 2012 shooting death of Rekia Boyd.  A judge found that Alvarez’s office should have charged the officer with a more serious offense.

Polling ahead of Tuesday’s contest showed a close race between Alvarez and Foxx, with More taking sizable chunk of the vote in her third-place finish.

But Fox ended up routing Alvarez. With 80% of the vote counted, Foxx had a 57%-to-29% lead over Alvarez.

Alvarez told her supporters that she was a good prosecutor, but fell short on the politics part of the job.

“I’ve been criticized that I wasn’t a very good politician,” she said. “That’s probably right. And that’s probably why I stand here tonight.”

Follow USA TODAY Chicago correspondent Aamer Madhani on Twitter: @AamerISmad