In yet another bizarre twist, a Chicago judge on Friday ordered the appointment of a special prosecutor to review the hoax case against “Empire” actor Jussie Smollett.

Judge Michael Toomin ruled that State’s Attorney Kim Foxx should have appointed a special prosecutor when she opted to recuse herself early in the case. Instead, Foxx turned the case over to her top deputy, Joseph Magats, who was named “acting” state’s attorney. A few weeks later, Magats decided to drop all charges against the actor in exchange for the forfeiture of a $10,000 bond.

“There was and is no legally cognizable office of Acting State’s Attorney known to our statutes or to the common law,” Toomin wrote. “Its existence was only in the eye or the imagination of its creator, Kim Foxx. But, she was possessed of no authority, constitutionally or statutorily, to create that office.”

The judge’s decision potentially means that Smollett could once again be charged with filing a false report.

“If reasonable grounds exist to further prosecute Smollett, in the interest of justice the special prosecutor may take such action as may be appropriate to effectuate that result,” Toomin wrote.

Smollett was accused of faking a hate crime against himself on Jan. 29 in order to garner attention. Smollett has maintained throughout that he was accosted and beaten by two men who yelled homophobic and racial slurs and put a noose around his neck.

The case has seesawed dramatically since then. Chicago police initially gave Smollett the benefit of the doubt, at least in public, saying he was being treated as a victim of a hate crime. But once investigators concluded he had fabricated the story and hired two men to beat him up, he was slammed with a 16-count indictment.

Foxx had recused herself early in the case, after it was revealed that she had spoken with a Smollett family member and tried to intervene to get federal authorities to investigate. She later argued that she had not formally recused her office, and had only personally stepped aside due to racist rumors that she and Smollett were related.

In his ruling, Judge Toomin called the “recusal that really wasn’t” “an exercise in sophistry.” The judge did not find enough evidence to show that Foxx had a genuine conflict of interest that would require her recusal, but held that once she made the decision to step aside, state law mandated the appointment of a special prosecutor.

Following the indictment, Foxx sent Magats a text message on March 8 suggesting it was overkill. “Sooo… I’m recused, but when people accuse us of overcharging cases… 16 counts on a class 4 becomes exhibit A,” she wrote.

Magats dropped the charges on March 26, sparking outrage from Mayor Rahm Emanuel and others who thought Smollett was handed a sweetheart deal. Retired Judge Sheila O’Brien filed a petition in April seeking the appointment of a special prosecutor to look into the case, and into Foxx’s handling of it.

In a statement, Foxx said she disagreed with the judge’s ruling.

“I am pleased that the court agreed there was no conflict of interest here,” she said. “Regarding recusal, I followed the advice and counsel of my then Chief Ethics Officer. In any event, I respectfully disagree with the court’s conclusion that, in the absence of any conflict, the appointment of a special prosecutor is required. As always, I remain committed to transparency, justice, and the public safety of the communities we serve.”

Under Illinois law, the state attorney general’s office will be asked to assume the role of special prosecutor. If the office is unwilling to take the case, the request would then go to county prosecutors’ offices around the state.

Smollett was written out of the last two episodes of “Empire.” While Fox picked up his contract for the upcoming final season, creator Lee Daniels recently said on Twitter that Smollett will not return.