International Criminal Court judges on Wednesday dismissed Chief Prosecutor Karim Khan from the crimes against humanity case against former Philippines president Rodrigo Duterte, citing a "reasonable appearance of bias."
But the decision will have little practical impact, with Khan currently on leave as investigators probe allegations of sexual assault against him.
Duterte is facing three counts of crimes against humanity at the ICC over his alleged involvement in murders as part of his "war on drugs".
The ex-president's defence team had sought Khan's dismissal as he had previously represented victims of Duterte's alleged crimes before taking up office as chief prosecutor.
The judges ruled that "importantly... the Appeals Chambers does not consider that actual bias on the prosecutor has been demonstrated."
However, they said that "a number of factors may give rise to an objectively reasonable appearance of bias in the eyes of a reasonable observer."
Khan's involvement with the victims meant he "could be expected to have formed an opinion on the individual criminal responsibility of Mr Duterte."
This could "adversely affect the required impartiality in his current role," the judges decided.
Referring to the allegations of sexual abuse, which Khan denies, the defence said this affected the presumption of the prosecutor's "high moral character."
Representatives of Duterte's alleged victims had called for the judges to dismiss the case as a moot point, given his current absence from the court.
Disqualifying Khan from the case would "serve no practical purpose whatsoever," the victims' lawyers said.
"This disqualification does not have an impact on the case itself," said ICC spokesman Fadi El Abdallah, adding the investigation is now being led by Khan's deputy.
The ruling comes days after the ICC decided Duterte would remain in custody as judges assess his fitness to be tried.
They said the 80-year-old posed a possible flight risk.
If judges decide he is medically fit to sit in court, the next stage of proceedings will be a "confirmation of charges" hearing, where lawyers will argue whether there are sufficient grounds for trial.