WASHINGTON — President Donald Trump said his longtime friend and political advisor Roger Stone has a "very good chance of exoneration," hours after a federal judge on Thursday sentenced the self-proclaimed dirty trickster to more than three years in prison.

Trump made the remarks during a graduation ceremony for formerly incarcerated people in Las Vegas, where he also railed against enemies both new and old, including the Justice Department, former FBI Director James Comey, whom Trump fired in May 2017, and the foreperson of Stone's jury.

"What happened to Roger Stone is unbelievable," Trump said, and "it isn't fair."

Nonetheless, said Trump, "I'm not going to do anything in terms of the great powers bestowed upon a president of the United States. I want the process to play out. I think that's the best thing to do. Because I'd love to see Roger exonerated, and I'd love to see it happen because I personally think he was treated very unfairly."

Stone was convicted late last year of seven felonies, including obstruction of a congressional investigation, lying to Congress and witness tampering. He was sentenced to 40 months in prison on Thursday.

Over nearly 20 minutes of off-script remarks during the nonprofit Hope for Prisoners event, Trump insisted that Stone had played no official role in his 2016 presidential campaign. But Trump simultaneously argued that the jury foreperson's opinion of Trump had irreparably tainted Stone's guilty verdict.

"Now, you wouldn't know about a bad jury," Trump said sarcastically to the audience of former inmates. "Anybody here know about bad juries? These people know more about bad juries than everybody here, including the sheriff and the mayor and everybody.They know about bad juries."

Stone's lawyers requested a new trial before Thursday's sentencing, alleging in a motion that the political opinions of the jury foreperson amounted to bias against Stone.

The president also used the opportunity to complain about people who have not been prosecuted, but who he thinks should be, including Comey, former FBI Deputy Director Andrew McCabe and former FBI lawyer Lisa Page.

"They say [Stone] lied, but other people lied, too" Trump continued. "Just to mention, Comey lied, McCabe lied, Lisa Page lied. ... You don't know who these people are. But just trust me, they all lied."

At the sentencing hearing Thursday, Judge Amy Berman Jackson excoriated Stone for what she said were deliberate, pernicious crimes, and not the result of persecution, as both Trump and Stone have previously claimed.

"He was not prosecuted, as some have complained, for standing up for the president," Berman Jackson said from the bench. "He was prosecuted for covering up for the president."