In a shocking move by Cook County prosecutors, all charges have been dropped against Empire actor Jussie Smollett—who was accused of faking a hate crime against himself–during a surprise court appearance on Tuesday.

The State’s Attorney’s Office said in a statement that the decision was made after reviewing the actor’s “previous community service” and in light of his “agreement to forfeit his bond to the City of Chicago.” “We believe this outcome is a just disposition and appropriate resolution to this case,” the statement said.

But Chicago Mayor Rahm Emanuel declared it “a whitewash of justice.”

“From top to bottom this is not on the level,” he said at a press conference Tuesday afternoon, alongside Chicago Superintendent Eddie Johnson.

Last week, Smollett pleaded not guilty to 16 counts of disorderly conduct for allegedly filing a false police report that claimed he was the victim of a racist and homophobic attack on Jan. 29 in Chicago. Police said the actor had paid two men to orchestrate the hate-crime attack in an effort to “promote his career.”

“Today, all criminal charges against Jussie Smollett were dropped and his record has been wiped clean of the filing of this tragic complaint against him,” his lawyers, Tina Glandian and Patricia Brown Holmes, said in a statement.

“Jussie was attacked by two people he was unable to identify on January 29th,” the statement continued. “He was a victim who was vilified and made to appear as a perpetrator as a result of false and inappropriate remarks made to the public causing an inappropriate rush to judgement.”

First Assistant State’s Attorney Joe Magats told The New York Times the actor’s charges were dropped in exchange for his agreement to do community service and forfeit his $10,000 bond to the city of Chicago.

“We didn’t exonerate him,” Magats told the newspaper, adding that the decision was made after prosecutors determined Smollett was not “a threat to public safety.”

Smollett has performed 16 hours of community service at The Rainbow Push Coalition, an organization founded by Jesse Jackson Sr. As part of his service, Smollett provided a critique of their broadcast studio, worked in the Rainbow Push bookstore, and spoke to prospective students and parents, the organization told The Daily Beast.

At a press conference, Holmes insisted the actor did not strike a deal and has “nothing to say to the police department except to investigate charges and not try their cases in the press but to allow matters to be investigated.”

The judge has sealed all the records in the case.

“I want you to know that not for a moment was it in vain. I have been truthful and consistent on every single level since day one,” Smollett told reporters after the Tuesday hearing. “I would not be my mother’s son if I was capable of one drop that I’ve been accused of.”

Smollett alleged that during the January attack, two men in ski masks tried to tie a rope around his neck and poured a chemical substance on him as he walked home from a Subway sandwich shop. During the attack, Smollett alleged the men called him several homophobic and racist slurs, before shouting: “This is MAGA country.”

Chicago police launched a hate-crime investigation, but quickly found multiple inconsistencies in Smollett’s story, and evidence suggested the actor was involved in his own alleged attack, authorities said.

In February, Smollett was initially charged with one felony count of disorderly conduct for allegedly filing a fake police report. Less than a month later, a Cook County grand jury increased the charges to over a dozen felony counts after police alleged Smollett staged the hate crime because he was “dissatisfied with his salary” on the Fox show. The next day, Smollett's character was cut from the rest of Empire’s fifth season.

“Do I think justice was served? No,” Chicago PD Superintendent Eddie Johnson said Tuesday. “I think this city is still owed an apology.”

A spokesperson for the Chicago PD confirmed to The Daily Beast that the department was not aware that Smollett’s charges would be dropped prior to the hearing, but declined to comment further.

“At the end of the day, it is Mr. Smollett who committed this hoax, period. If he wanted to clear his name, the way to do that is in a court of law so everyone can see the evidence,” Johnson continued. “I stand by the facts of what we produced.”

The actor has repeatedly denied all claims he was involved in the alleged attack. Smollett’s family issued a statement on Tuesday, calling the dropped charges “vindication” for Jussie, who is “a victim of an assault and then falsely blamed for his own attack” that was “unjustly smeared.”

“While many were quick to rush to judgement before hearing the actual truth, we are grateful that the truth about Jussie has come to light,” the statement said.

Cook County State’s Attorney Kim Foxx recused herself from the investigation last month, but did not provide details on that decision.

Smollett’s emergency hearing comes just one day after his former attorney was identified as a co-conspirator in a federal extortion case involving ex-Stormy Daniels attorney Michael Avenatti.

Mark Geragos, a celebrity lawyer who previously represented Michael Jackson and now reps Colin Kaepernick, has denied all the allegations.

“It is important to note that Mr Geragos has not been charged with any criminal conduct whatsoever,” Geragos’ attorney said in a statement Monday.