Kimm Foxx beat Anita Alvarez in the Cook County State's Attorney's race. View Full Caption DNAinfo/Stephanie Lulay

CHICAGO — In the wake of her handling of the Laquan McDonald case, Cook County State's Attorney Anita Alvarez lost her bid for reelection by a wide margin to Kim Foxx on Tuesday night.

With 100 percent of the vote counted, Foxx had nearly 58 percent of the vote to Alvarez's 29 percent. Challenger Donna More was a distant third with 13 percent.

In front of a crowd of hundreds of supporters and flanked by her husband and daughters at the Holiday Inn Chicago Mart Plaza in River North, Foxx said that the race was not only about "saying goodbye" to a Alvarez.

"It's about turning the page," she said.

RELATED: GET LIVE ELECTION RESULTS HERE

At 9 p.m., Alvarez called Foxx to concede the race and offer her congratulations. Speaking at the Palmer House Hilton, she defended the job she did as the county's chief prosecutor.

"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.

"I'm damn proud of the fact that I am a good prosecutor," Alvarez said. " ... I'm very, very proud of the work that I have done in this job."

Foxx, a first-time candidate who is a close ally of Cook County President Toni Preckwinkle, thanked her team for being patient with her.

"Beyonce has the beehive, but [that's got] nothing on my team," she said to cheers.

Former Gov. Patt Quinn, former Illinois Senate President Emil Jones and other politicians were in the room to celebrate Foxx's primary win Tuesday night. Also there were Black Lives Matter activists Ja'Mal Green and Jared Steverson in "Adios Anita" tees and an uncle of Laquan McDonald, the teen who was shot and killed by a Chicago cop in 2014.

Alvarez's reelection bid was widely seen as a referendum on her handling of alleged cases of police misconduct, including the McDonald case, in which she took 13 months before charging the Chicago police officer who shot McDonald 16 times. Critics started a Twitter hashtag — #byeanita — and demanded she step down.

In her speech, Alvarez thanked her fellow prosecutors "for your hard work and the sacrifices you have made because we all know this is a job that doesn't pay very well. I know that you could be out in the civil world making more money, but I know you do this job for the same reasons that I do this job — and that's for the victims."

Alvarez said she would continue to "serve the victims here in Cook County" for the rest of the year but said she assured Foxx "there would be a smooth transition."

Foxx still must win the general election in November against Republican Christopher E.K. Pfannkuche, a longtime prosecutor.

Supporters of Foxx, a close ally of Cook County President Toni Preckwinkle, were in a festive mood Tuesday night as some people swayed to "Rhythm of the Night" at the Holiday Inn Chicago Mart Plaza in River North.

"The gulf between law enforcement and our community must be bridged," Foxx told supporters. " ... We all have the same and common goal, which is public safety. ... The work we have to do is going to take an all-hands on deck approach."

"I'm humbled, I'm honored and I thank you."

Many supporters in the crowd ripped Alvarez.

"We got her out of here," said Ja'Mal Green, who was wearing a "Bye Anita" T-shirt. "We can call it."

As she watched the results come in, Foxx supporter Marcetta Jamison jumped up with excitement. It's nearly a done deal, she said.

"We were very confident" she would win, Jamison said. "We knew she'd be the frontrunner."

Protester Ja'Mal Green & others I. "Bye Anita" tees at @KimFoxxforSA #ILPrimary #Election2016 @DNAinfoCHI pic.twitter.com/OWStpGUDDn

— Stephanie Lulay (@slulay2) March 16, 2016

Campaign manager Mike Carson says Anita Alvarez will work with Foxx for "a smooth transition" @DNAinfoCHI pic.twitter.com/Nvz7cPFVjN — Erica Demarest (@ericademarest) March 16, 2016

Alvarez made history in 2008 when she became the first female and first Hispanic candidate to be elected as the county's top prosecutor.

But Alvarez came under scrutiny in recent months following the Nov. 24 release of dashcam footage from the McDonald shooting. Alvarez waited more than a year to file charges and admitted in November that the video release pushed up her timeline, saying she did so in the interest of "public safety."

READ: How #ByeAnita was organized by @AssataDaughters @BLMChi @BYP_100 + more: https://t.co/mVg7MWvZUd #16Shots pic.twitter.com/IhZRTaxd0M

— Chicago Rising (@ChicagoRising) March 16, 2016

Preckwinkle and Cook County Commissioner Jesus "Chuy" Garcia (D-Chicago) are among those who have called for Alvarez's resignation.

Although the county Democratic Party initially backed Alvarez, it dropped her and tapped Foxx, who was Preckwinkle's chief of staff. Both the Tribune and Sun-Times endorsed Foxx.

Preckwinkle's campaign fund contributed $250,000 toward Foxx's effort. Foxx's connection to the Cook County Board president has led to critics to charge that Preckwinkle would control the state's attorney's office, a claim Foxx denies.

For more neighborhood news, listen to DNAinfo Radio here: