Cook County State Attorney Kim Foxx's handling of the controversial Jussie Smollett alleged hate crime case -- including the contentious decision to suddenly drop all charges against him -- will be examined by a special prosecutor, an Illinois judge ruled Friday afternoon.

The decision by Cook County Judge Michael Toomin comes after a deluge of criticism and second-guessing regarding Foxx's management of the case, in which Smollett claimed he was attacked in the early morning hours of Jan. 29 while walking home to his Chicago apartment.

Toomin, according to the Chicago Tribune, said the special prosecutor could re-charge Smollett.

Foxx has defended her handling of the case and previously said she would welcome an independent investigation. But her office opposed a special prosecutor, explaining the investigation would just duplicate the efforts of a county inspector general's office probe that is already underway.

Smollett, who plays the character Jamal Lyon on the TV show “Empire,” was accused in February by Chicago police of faking the attack. He has denied the allegations and prosecutors later dropped each of the 16 charges he faced.

Toomin suggested Friday that Foxx mishandled the 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 former first lady 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.

CLICK HERE TO GET THE FOX NEWS APP

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 quoted him as saying.

The Associated Press contributed to this report.