Former Trump campaign adviser Rick Gates pleaded guilty Friday to two criminal charges stemming from the special counsel’s probe into Russian meddling in the 2016 US election, and agreed to cooperate with the investigation.

Gates, who served as Trump’s deputy campaign chairman, was facing decades behind bars — but will now serve only up to six years after pleading guilty to conspiracy to defraud the US and making a false statement.

As part of the plea deal, he’ll help special counsel Robert Mueller in “any and all matters” as prosecutors continue to investigate Russian election interference and Gates’ longtime business associate, Paul Manafort.

Gates, 45, is the third former Trump aide to cooperate with Mueller, and the fifth person to plead guilty in the probe.

Manafort and Gates were initially charged in a 12-count indictment last October with unregistered lobbying and conspiring to launder $75 million they received while doing work for a pro-Russian Ukrainian political party.

On Thursday, they were slapped with a slew of new tax-evasion and bank-fraud charges in a superseding indictment that alleged they had laundered $30 million and failed to pay taxes for 10 years.

According to papers filed Friday, Gates, 45, admitted to lying to the feds about a March 19, 2013, meeting with Manafort, a lobbyist and Rep. Dana Rohrabacher (R-Calif.).

Gates claimed they didn’t discuss Ukraine at the meeting, but they did, according to the filing.

Manafort released a statement Friday saying he maintains his innocence.

“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,” he said.

Hours later, prosecutors filed new charges against Manafort, accusing him of secretly paying former European politicians to lobby for Ukraine.

Some of the covert lobbying took place in the US, the newly unsealed indictment said.

Gates told family and friends in a letter that he made a deal after having “a change of heart.”

“The reality of how long this legal process will likely take, the cost, and the circus-like atmosphere of an anticipated trial are too much. I will better serve my family moving forward by exiting this process,” he said.

“The consequence is the public humiliation, which at this moment seems like a small price to pay for what our children would have to endure otherwise.”