President Trump on Thursday took to Twitter to comment on his longtime associate Roger Stone’s sentencing in federal court.

The commander-in-chief — a staunch Stone defender — took aim at several longtime foes and accused them of lying to Congress, one of several charges Stone was convicted of last November.

“’They say Roger Stone lied to Congress.’ @CNN. OH, I see, but so did Comey (and he also leaked classified information, for which almost everyone, other than Crooked Hillary Clinton, goes to jail for a long time), and so did Andy McCabe, who also lied to the FBI! FAIRNESS?” Trump tweeted at 10:22 a.m., as Stone sat in a courtroom awaiting sentencing from DC federal Judge Amy Berman Jackson.

The feds decided not to prosecute McCabe last week despite his admission that he misled investigators probing leaks from the FBI.

Trump has repeatedly accused Comey of lying, a claim which Comey has denied.

Stone was convicted of lying to lawmakers investigating Russian interference in the 2016 presidential election.

He was indicted in January 2019 as part of special counsel Robert Mueller’s probe into whether Russia colluded with the Trump campaign.

He was found guilty on all seven counts against him — one count of obstruction of an official proceeding, five counts of making false statements and one count of witness tampering.

Thursday’s action in federal court followed Trump’s persistent defense of his longtime confidant, which led to Attorney General William Barr saying prosecutors were too harsh when they recommended Stone serve seven to nine years under federal sentencing guidelines.

Barr’s move prompted four prosecutors to quit Stone’s case.