Just before her now-infamous meeting on June 9 of last year with Donald Trump Jr. at Trump Tower, Russian attorney Natalia Veselnitskaya was in court as a former U.S. attorney general tried to pull off an audacious legal maneuver against the U.S. government.

The meeting, arranged after Trump Jr. was offered information to “incriminate Hillary” as part “of Russia and its government’s support for Mr. Trump,” had originally been scheduled for 3 p.m., but was moved back an hour because “the Russian government attorney” had to be in court that afternoon, according to the email thread arranging it.

That was the same day that Michael Mukasey, who served as attorney general under George W. Bush, appeared before a panel of three judges on the Court of Appeals for the Second Circuit to argue that Prevezon—the Kremlin-tied company then charged with hiding a fraction of a $230 million Russian tax scheme in Manhattan luxury real estate—should be allowed to keep a lawyer it had effectively poached from the other side.

Veselnitskaya, who represented the company’s owner as it prepared to defend itself at trial, did not register an official appearance with the appeals court, and the SDNY declined to comment on her presence there. A recording of the proceeding, obtained by The Daily Beast, makes clear that both of her stops in Manhattan that day—in court and then in Trump Tower—were part of the same aggressive Kremlin campaign to try and overturn the Magnitsky Act, which infuriated President Vladimir Putin by imposing sanctions on 44 prominent Russians.

Ultimately the panel ruled against Prevezon, deeming the circumstances were “truly are extraordinary” and removing the lawyer, saying his presence would “taint” the trial.

Their unanimous judgment wasn’t handed down until October 2016, but Veselnitskaya may well have realized from the probing nature of the judges’ questions that the hearing had not gone well by the time she left the court building at the foot of the Brooklyn Bridge and made her way uptown to Trump Tower.

At the meeting there, where Clinton dirt had been promised, Veselnitskaya and Rinat Akhmetshin reportedly asked Trump’s son, son-in-law, and campaign manager to soften U.S. sanctions on Russia in exchange for an end to the ban on American adoptions of Russian orphans passed in retaliation for those sanctions.

Congress had passed those as a result of the $230 million fraud Prevezon had been charged with facilitating and that had been uncovered by Sergei Magnitsky, who was later arrested, murdered in a Russian jail cell and then convicted by a Russian court after his death of tax fraud.

To try and fight the charges in Manhattan, Prevezon hired one of the American lawyers who knew most about the fraud: John Moscow, a lawyer specializing in white-collar crime at the firm BakerHostetler.

A swashbuckling former assistant district attorney in Manhattan whose work in the world of cross-border corruption became the subject of a Hollywood thriller starring Clive Owen, Moscow spent nine months in 2008 chasing down the criminal money trail for Magnitsky’s employer, Bill Browder. He drew up an outline of the $230 million Russian fraud, met with the Department of Justice to describe the scale of the theft, and came up with the idea of chasing the missing funds, some of which were dispersed in dollar transactions, through New York.

When Prevezon needed a lawyer five years later, who better to hire than the man who had helped to draw up the case against them?

When prosecutors objected, the company originally argued that there was no conflict of interest because Moscow, a partner at BakerHostetler, would not be using his knowledge to undermine Browder or his company, since Prevezon’s defense did not intend to attack them in its defense. That had changed, though, by the time the judges heard the appeal on the day of Trump Tower meeting, as the company had then shifted arguments ahead of an anticipated trial to argue—as various Russian officials long had—that the victims in the case, Browder and his company, Hermitage, were the real fraudsters.

“They involve issues that are the same,” assistant U.S. attorney Paul Monteleoni explained to the judges on June 9, effectively admitting that the Prevezon case was not a simple money laundering one but a fact-finding mission closely related to the death of the lawyer Magnitsky, with the Russian government itself closely tracking the American court proceedings.

“The chief prosecutor of a sovereign nation has issued an open letter saying, we are watching the proceedings in the U.S.,” Monteleoni said, referring to Russia’s prosecutor general Yury Chaika. “And the chief prosecutor actually said, we’re continuing to investigate Browder, the CEO of Hermitage, and to stay tuned for more developments.”

Chaika was also the alleged source of the “official documents and information that would incriminate Hillary,” that were dangled in front of Don Jr. in the email that led to the Trump Tower meeting with Veselnitskaya.

Two months earlier, it had been Chaika’s office that handed instructions and an anti-Magnitsky propaganda movie to Rep. Dana Rohrabacher, who went on to defend Putin in D.C. in accordance with those instructions.

Veselnitskaya, a personal friend of Chaika, had been in the U.S. court hearings to represent Prevezon’s on so-called immigration parole after being denied a proper visa. Her parole expired in February of 2016, shortly after Prevezon had made an abrupt switch in its defense as its trial date approached and began arguing that Browder and his company weren’t the victims but rather the perpetrators of the fraud. The State Department then reversed itself and issued her a visitor’s visa in June—just days before her visit to court and Trump Tower.

Four months after Veselnitskaya’s momentous June visit, the appeals panel made the extremely rare decision to issue a writ of mandamus—striking down what another judge had already ruled—because of the “extraordinary circumstances” of the case.

“A client cannot fully and candidly discuss its situation with counsel if the client must worry that such confidences could be used to implicate him in the very crimes for which he hired that attorney to defend him, significantly undermining the lawyer-client relationship,” Judge Rosemary Pooler wrote for the unanimous panel.

The judge wrote that Musakey’s arguments—that Moscow had waived confidentiality when he first approached the U.S. government with his findings about the fraud—threatened to undermine the U.S. government’s ability to gather evidence against major criminals.

“If crime victims fear that the attorneys they hire may turn against them,” she wrote. “They may be less likely to assist government in its investigations.”

The ruling was described at the time as a “startling twist” by the weekly financial magazine Barron’s, who deemed it “a severe rebuke for BakerHostetler and lawyer Moscow.”

(Mukasey, scheduled to testify Tuesday at an unrelated hearing of the House Foreign Affairs Committee, is also working along with Rudy Giuliani on an extrajudicial settlement for a client with close ties to the Turkish government, Reza Zarrab, who the SDNY has charged with violating Iran sanctions. Mukasey has repeatedly dismissed suggestions that the Trump campaign may have broken the law by colluding with Russia.)

The United States’ case against Prevezon was ultimately settled on the eve of the trial—one month after President Trump fired then-Southern District U.S. Attorney Preet Bharara—with the defendants, making no admission of guilt, agreeing to pay $5.9 million.