CHICAGO — A judge on Friday ordered that a special prosecutor be appointed to independently investigate charges that the actor Jussie Smollett staged a racist hate crime against himself, as well as the prosecutors’ abrupt decision in March to drop the felony counts against him.

The judge’s order concerned the decision by Kim Foxx, the Cook County state’s attorney, to separate herself from the investigation and appoint her deputy, Joseph Magats, as “acting state’s attorney” to oversee the case. In a sharply critical ruling, Judge Michael P. Toomin of the Circuit Court of Cook County wrote that the decision raised “problematic concerns” because the proper procedure should have involved Ms. Foxx asking the court to appoint a special prosecutor.

Instead, Judge Toomin wrote, Ms. Foxx’s breach of protocol resulted in a “fictitious office” with no “legal existence” having control over the Smollett case.

[A timeline of the Jussie Smollett case.]

“There was and is no legally cognizable office of acting state’s attorney known to our statutes or to the common law,” the judge wrote. “Its existence was only in the eye or imagination of its creator, Kim Foxx.”