A judge appointed a special prosecutor on Friday to investigate the decision to dismiss all charges against the Empire actor Jussie Smollett, who was accused of lying to the police by claiming he was the victim of a racist and homophobic attack in downtown Chicago in January.

Cook county judge Michael Toomin suggested that the county’s state’s attorney, Kim Foxx, mishandled the Smollett case by appointing a top aide to oversee it after she recused herself.

Foxx had been in contact with a relative of the actor and had been approached by Michelle Obama’s one-time chief of staff on behalf of Smollett’s family, and she explained at the time that she was recusing herself to avoid “even the perception of a conflict” of interest.

In his ruling, Toomin said he had no problem with Foxx’s recusal, but that she had no right to select someone from her office to handle the prosecution, saying what she did amounted to naming her own special prosecutor.

“State’s attorneys are clearly not meant to have unbridled authority to appoint special prosecutors,” the Chicago Tribune reported. “She appointed (her top assistant) to an office, to an entity, that has no legal existence. “There isn’t an office of the ‘acting state’s attorney.’ It existed only … in the imagination of Ms Foxx.”

Foxx has been under fire for her handling the investigation, including from the Chicago police department and the former mayor, Rahm Emanuel.

Her office charged Smollett with 16 counts of disorderly conduct after police concluded that he had staged the early-morning 29 January attack on himself and had paid two acquaintances to help him pull it off, in order to draw attention to himself in a way he thought would help his career.

But all of the charges were suddenly dropped weeks later, prompting an outcry from police and leading a former state appellate judge, Sheila O’Brien, to call for a special prosecutor.

In calling for a special prosecutor, O’Brien said it appeared to her and others that Smollett had “received special treatment” from Foxx’s office.

Foxx defended her handling of the case and said she would welcome an independent investigation.