WASHINGTON — Rick Gates is going to jail. But only on the weekends.

Gates, 47, a former campaign aide to President Trump, received a mixed sentence on Tuesday, getting 36 months of probation and an “intermittent” jail sentence of 45 days that can be served on weekends or days negotiated with the authorities.

Gates pleaded guilty in February 2018 to charges of lying to investigators and conspiring with his former boss, former Trump campaign chair Paul Manafort, to hide millions the pair earned while engaged in illegal lobbying for the government of Ukraine years ago.

Gates’ light sentence shows how much it pays to cooperate with the feds: He’d otherwise face some four or five years, even with his guilty plea.

Gates provided what prosecutors described as “extensive” cooperation with investigators, which helped take down his own former friends and business associates Paul Manafort and Roger Stone. All three were once top political advisers to Trump.

Manafort, 70, has already been in jail for 18 months while serving a seven-and-a-half-year sentence for bank and tax fraud and illegal foreign lobbying, after first fighting the charges.

Stone was found guilty of lying to Congress, witness tampering, and obstruction of justice in November.

Manafort and Gates were indicted together in October 2017 as early targets of former Special Counsel Robert Mueller, who pursued them over their decade of work for the Russia-friendly former President of Ukraine, Viktor Yanukovych.

That illegal lobbying campaign, which included efforts to recruit high-profile European politicians to try to influence American decision-makers in Ukraine’s favor, earned both men millions, which they hid from American tax officials in a network of offshore bank accounts.

Gates, clean-shaven and wearing a grey suit and light blue tie, stood glumly in the courtroom on Tuesday morning listening to Judge Amy Berman Jackson deliver a damning recitation of his own behavior, including how he lied and cheated before providing hundreds of hours of devastating testimony against his own former friends and colleagues.

“It's hard to overstate the amount of lies or the amount of money involved”

“It’s hard to overstate the amount of lies or the amount of money involved,” Jackson said. “All along they were hiding the fact that they and the Ukrainians had all these people on their payroll.”

Jackson, who has overseen several other key trials against Trump associates, including Manafort and Stone, also took multiple thinly-veiled shots at the Trump administration.

While blasting Gates for his crimes, she praised him for then delivering real facts — and no “alternative facts,” in a direction quotation of a notorious phrase once uttered by Trump adviser Kellyanne Conway.

Jackson praised Mueller’s investigation into the Trump campaign’s ties to Russia as warranted and appropriate. Her remarks appeared to be a tacit rebuke to the probe’s many critics in Trump’s circle, including Attorney General William Barr, who is now overseeing a criminal investigation into the origins of the FBI probe preceding Mueller’s appointment.

Gates’ testimony by itself turned up enough disturbing evidence to warrant investigation, Jackson said, citing his account of numerous links between people associated with the Trump campaign and those connected to Russia and renegade transparency group WikiLeaks, which leaked emails hacked by Russia at the height of the 2016 campaign.

Manafort had urged Gates not to plead guilty and cooperate with Mueller, and promised Gates there would be a “defense fund” to help cover the costs of fighting in court, prosecutor Molly Gaston said on Tuesday.

Gates flipped anyway. And his testimony was a “turning point” in the case against Manafort, Gaston said.

At Manafort’s Virginia trial last year, Gates refused to look at his former boss from the witness stand while testifying about the millions they earned together working for Ukraine and hid from American tax authorities. Manafort glowered at Gates with red-hot intensity.

Gates remains an important cooperator with ongoing federal investigations, including with some matters that are still secret and could result in future criminal trials, prosecutors said Tuesday.