The Georgia Court of Appeals removed Fulton County District Attorney Fani Willis from an election subversion case against President-elect Donald Trump.

Willis is expected to appeal against the ruling, which is seen as a major legal victory for Trump.

The ruling reverses the trial judge’s decision to allow Willis to stay on the case after it was revealed she had a romantic relationship with a prosecutor she had hired.

Willis brought sweeping charges against Trump and more than a dozen co-defendants last year for an alleged scheme to overturn the Republican’s election loss in the state to Joe Biden in 2020.

“After carefully considering the trial court’s findings in its order, we conclude that it erred by failing to disqualify Willis and her office,” the three-judge panel wrote in its decision.

The court’s decision does not dismiss the indictment against Trump and his co-defendants, meaning a new prosecutor will be assigned to the case against them.

Willis, however, has filed notice that she will appeal to the Georgia Supreme Court, and the official who would appoint her replacement declined to comment on his next steps.

“At this point, all avenues of appeal have not been exhausted,” Pete Skandalakis, director of the Prosecuting Attorneys’ Council of Georgia, told CBS News, the BBC’s news partner.

Trump is unlikely to face a trial until after his time in the White House, but some of his co-defendants could face trials sooner.

Several, including Trump allies Sidney Powell and Kenneth Chesebro, have pleaded guilty in the case.

The case Willis brought against Trump became marred in controversy earlier this year, when it was revealed she had a personal relationship with lead prosecutor Nathan Wade, whom she hired for the case.

That revelation led to days of testimony from Willis and Mr Wade, during which she revealed she had a romantic relationship with Mr Wade but denied she benefitted financially from that relationship.

The judge overseeing the case said Willis had a “serious lapse in judgment” and the case was damaged by “appearance of impropriety,” but he said the case could move forward with Willis remaining on it as long as Mr Wade stepped aside.

He later stepped down.

Trump and his co-defendants in the case used Willis and Mr Wade’s conflict of interest as grounds to appeal the case, arguing that Willis should not be allowed to stay on.

In Thursday’s ruling, the appeals court panel agreed.

“While we recognize that an appearance of impropriety generally is not enough to support disqualification, this is the rare case in which disqualification is mandated and no other remedy will suffice to restore public confidence in the integrity of these proceedings,” the appeals court wrote.

One of the three judges on the panel did, however, dissent to the ruling. Judge Benjamin Land wrote that the court had “no authority” to dismiss the previous court’s decision not to disqualify Willis even if there was an “appearance of impropriety”.

Ashleigh Merchant, the lawyer for one of Trump’s co-defendants, Michael Roman, told CBS News, the BBC’s US partner, that Willis should not have been allowed to prosecute the case.

Willis has claimed her relationship with Mr Wade did not influence the case. She could still appeal Thursday’s verdict.

Neither Trump nor Willis have spoken publicly about the Thursday decision.