Rick Gates has gone from Team Trump to Team Mueller.

The former senior official on Donald Trump’s presidential campaign has agreed to cooperate with special counsel Robert Mueller’s investigation into whether the campaign colluded with Russia. As part of his plea deal, Gates agreed to testify at “any and all trials,” which would include the upcoming trial for his former business partner and campaign boss, Paul Manafort.

Gates admitted to helping Manafort run a secret scheme to influence American politics on behalf of Ukraine’s then-ruling party, aligned with Moscow, and living like an oligarch in return for it. Manafort and Gates were accused Thursday of laundering more than $30 million in money from Ukraine, which they spent on luxury cars, real estate, and more.

Gates’ flip from defendant to witness was announced in federal court in Washington, D.C., on Friday after he pleaded guilty to one count of making a false statement to the FBI and one count of conspiracy against the United States related to financial crimes. (Manafort was also charged.)

“Notwithstanding that Rick Gates pled today, I continue to maintain my innocence,” Manafort said in a statement. “I had hoped and expected my business colleague would have had the strength to continue the battle to prove our innocence. For reasons yet to surface he chose to do otherwise. This does not alter my commitment to defend myself against the untrue piled up charges contained in the indictments against me.”

According to a stipulation signed by Gates, he dealt with Manafort’s tax accountants and hid for Manafort millions of dollars in foreign income and overseas bank accounts. Together they wired millions of dollars in income, according to Gates.

The money came from their work in Ukraine for the country’s Moscow-aligned ruling party. Gates and Manafort also lobbied the U.S. government on behalf of Ukraine, but did not register as foreign agents with the Justice Department. “Manafort, together with Gates’ assistance, engaged in a scheme to avoid this registration requirement,” according to Gates’ stipulation.

Manafort would communicate with Ukraine’s then-president and his staff, the stipulation said, while Gates would coordinate the work of two American companies lobbying Washington on behalf of Kiev.

Even after they were told to register as foreign agents, Gates said he and Manafort submitted false letters to the Justice Department about their lobbying work. For instance, they claimed the lobbying effort “did not include meetings or outreach within the U.S.,” according to the stipulation. Gates said he engaged in “weekly scheduled calls” and emails with his clients.

In order to further hide the lobbying effort, Gates said he and Manafort paid a group of former European politicians more than 2 million euros to lobby the U.S on behalf of Ukraine. It was called the “Hapsburg group,” according to a superseding indictment filed against Manafort on Friday.

Gates didn’t just admit to complex financial crimes connected to work for a foreign government; he also confessed that he lied to Mueller’s own investigators.

While negotiating a plea deal with Mueller’s team, Gates lied—per his stipulation—by falsely claiming Manafort didn’t discuss Ukraine in a meeting with another lobbyist.

Gates agreed to be interviewed by investigators as part of the plea deal. While none of the crimes alleged concern the Trump campaign, Gates would bring inside perspective to investigators about the operation. The other charges against Gates were dropped in exchange for his guilty plea and agreement to cooperate.

Gates joins former national security adviser Michael Flynn and former campaign official George Papadopoulos as cooperating witnesses for Mueller. Flynn and Papadopoulos each pleaded guilty to lying to the FBI.