Anwar had been scheduled to testify in the trial for the first time, but his defense team insisted that High Court Judge Mohamad Zabidin Diah was biased and should be replaced before the case can proceed.

Anwar faces up to 20 years in prison if convicted of sodomizing a 25-year-old former male aide in 2008. He claims the charge is politically motivated, but the government denies it.

Mohamad Zabidin, who had already dismissed two previous attempts by the defense to have him replaced, overruled Anwar for the third time, but allowed hearings to be delayed until July 13 so Anwar’s lawyers can appeal to a higher court.

Mohamad Zabidin ruled last month that prosecutors have established a credible case and that defense lawyers should start calling their witnesses.

Anwar claims that statements made by the judge about how Anwar’s accuser was a truthful and reliable witness showed that he had already formed an opinion against Anwar.

If Anwar wins his bid to have Mohamad Zabidin dismissed, he also wants a fresh trial because he insists the judge had allowed the prosecution to submit tainted evidence.

The trial is a major distraction for Anwar as he prepares his opposition alliance for general elections widely expected within a year. Prime Minister Najib Razak’s ruling coalition is working to regain at least a two-thirds parliamentary majority and recapture several states that Anwar’s alliance wrested in 2008 polls.