Fulton County District Attorney Fani Willis must step aside from the Georgia election interference case against Donald Trump or remove the special prosecutor with whom she had a romantic relationship before the case can proceed, the judge overseeing it ruled Friday.

Fulton County Superior Court Judge Scott McAfee did not find that Willis’ relationship with special prosecutor Nathan Wade amounted to a conflict of interest that should disqualify her from the case. However, he said, the allegations created an “appearance of impropriety” that infected the prosecution team.

“As the case moves forward, reasonable members of the public could easily be left to wonder whether the financial exchanges have continued resulting in some form of benefit to the District Attorney, or even whether the romantic relationship has resumed,” the judge wrote.

“Put differently, an outsider could reasonably think that the District Attorney is not exercising her independent professional judgment totally free of any compromising influences. As long as Wade remains on the case, this unnecessary perception will persist.”

A spokesperson for Willis did not immediately respond to a text message seeking comment on the judge’s ruling Friday.

Willis hired Wade to lead the team to investigate and ultimately prosecute Trump and 18 others accused of participating in a wide-ranging scheme to illegally try to overturn Trump’s narrow loss to Democrat Joe Biden in Georgia in 2020. Willis and Wade testified at a hearing last month that they had engaged in a romantic relationship, but they rejected the idea that Willis improperly benefited from it, as lawyers for Trump and some of his co-defendants alleged.

McAfee wrote that there was insufficient evidence that Willis had a personal stake in the prosecution. But he condemned what he described as a “tremendous” lapse in judgment and the “unprofessional manner of the District Attorney’s testimony.” Even so, he said dismissal of the case was not the appropriate remedy to “adequately dissipate the financial cloud of impropriety and potential untruthfulness found here.”

McAfee found no showing that the due process rights of Trump and the other defendants had been violated or that the issues involved prejudiced them in any way. He also said the disqualification of a constitutional officer, like a district attorney, is not necessary “when a less drastic and sufficiently remedial option is available.”

The judge said he believes that “Georgia law does not permit the finding of an actual conflict for simply making bad choices — even repeatedly — and it is the trial court’s duty to confine itself to the relevant issues and applicable law properly brought before it.”

An attorney for co-defendant Michael Roman asked McAfee to dismiss the indictment and prevent Willis and Wade and their offices from continuing to prosecute the case. The attorney, Ashleigh Merchant, alleged that Willis paid Wade large sums for his work and then improperly benefited from the prosecution of the case when Wade used his earnings to pay for vacations for the two of them.

Willis had insisted that the relationship created no financial or personal conflict of interest that justified removing her office from the case. She and Wade both testified that their relationship began in the spring of 2022 and ended in the summer of 2023. They both said that Willis either paid for things herself or used cash to reimburse Wade for travel expenses.

The sprawling indictment charges Trump and more than a dozen other defendants with violating Georgia’s Racketeer Influenced and Corrupt Organizations Act, known as RICO. The case uses a statute normally associated with mobsters to accuse the former president, lawyers and other aides of a “criminal enterprise” to keep him in power after he lost the 2020 election to Biden.

Trump, Republicans’ presumptive presidential nominee for 2024, has denied doing anything wrong and pleaded not guilty.

Earlier this week, the judge dismissed some of the charges against Trump.

The six challenged counts charged the defendants with soliciting public officers to violate their oaths. One count stemmed from a phone call Trump made to Georgia Secretary of State Brad Raffensperger, a fellow Republican, on Jan. 2, 2021, in which Trump urged Raffensperger to “find 11,780 votes” for him to win the election in the state.

Another of the dismissed counts accused Trump of soliciting then-Georgia House of Representatives Speaker David Ralston to violate his oath of office by calling a special session of the legislature to unlawfully appoint presidential electors.

McAfee said the counts did not allege sufficient detail regarding the nature of the violations.