Paul Manafort, the former chairman of President Donald Trump’s 2016 campaign, pleaded guilty to federal charges Friday, averting a second trial that had been scheduled for next week.

At a hearing in District of Columbia federal court, Manafort entered a guilty plea to counts of conspiracy against the United States and conspiracy to obstruct justice. The charges were related to his political consulting work for Ukrainian politicians and involve conduct that occurred before he joined Trump’s campaign.

Court documents filed Friday by special counsel Robert Mueller’s office revealed prosecutors have dropped most of the charges in the case in exchange for his plea. Manafort has also reached a “cooperation agreement” with the Justice Department, but prosecutor Andrew Weissman did not elaborate on the specifics of that deal in court.

The two counts Manafort pleaded guilty to could each carry a sentence of up to five years in prison. According to CNN, his agreement includes interviews with the special counsel without his attorneys present, turning over documents, and testifying if needed.

"He wanted to make sure that his family was able to remain safe and live a good life. He's accepted responsibility. This is for conduct that dates back many years and everybody should remember that," said Kevin Downing, Manafort's attorney.

Mueller is investigating Russian interference in the 2016 election, including possible connections to Trump's campaign. The president's personal attorney, Rudy Giuliani, stressed in a statement Friday that "the president did nothing wrong."

"This had absolutely nothing to do with the president or his victorious 2016 Presidential campaign. It is totally unrelated,” White House Press Secretary Sarah Sanders said in a statement after the news broke.

Last month, a Virginia jury convicted Manafort of eight counts including tax evasion, failing to report foreign bank accounts, and bank fraud. The jury deadlocked on 10 other counts. He is already facing seven to 10 years in prison in that case.

As part of his plea Friday, Manafort admitted guilt to the remaining counts in the Virginia indictment and agreed to the forfeiture of several real estate properties and bank accounts.