Roger Stone, a longtime Republican operative and staunch ally of President Donald Trump, was sentenced Thursday to 40 months in prison in a case brought by Robert Mueller’s special counsel investigation.

U.S. District Court Judge Amy Berman Jackson said that while Stone’s actions merited jail time, the seven to nine years initially recommended by the Department of Justice was excessive. Jackson also denied accusations that the operative was in legal trouble due to his political beliefs or affiliations.

“He was not prosecuted, as some have claimed, for standing up for the president. He was prosecuted for covering up for the president,” the judge stated.

Stone was convicted in November on seven criminal counts, including making false statements to Congress regarding his communications with WikiLeaks during the 2016 presidential election, tampering with witness Randy Credico, and obstructing the House investigation into the president’s now-debunked coordination with Russia.

The sentencing comes after President Trump repeatedly criticized an initial recommendation by the Department of Justice that Stone receive at least seven years in jail, calling it a “miscarriage of justice.” Following the recommendation, Attorney General William Barr called for a reduction in suggested prison time against the Republican political operative, leading to four prosecutors removing themselves from the case. In an interview with ABC News, Barr batted away speculation that he had been directed by the White House to personally involve himself in the case.

It is unclear whether President Trump will pardon Stone. Earlier Thursday, he tweeted a clip of Fox News Channel host Tucker Carlson stating that the president could end the “travesty” of the case. “Democrats will become unhinged if Trump pardons Stone, but they’re unhinged anyway,” Carlson said in a Wednesday segment. “What has happened to Roger Stone should never happen to anyone in this country of any political party. It’s completely immoral, it’s wrong. Fixing it is the right thing to do.”

President Trump later tweeted: ““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?”

“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? — Donald J. Trump (@realDonaldTrump) February 20, 2020

“The court cannot be influenced by those comments,” Jackson said of the tweets without referring to the president by name. “They were entirely inappropriate.”

Last week, Stone’s legal team filed a motion requesting a new trial after the jury’s foreperson expressed support for the prosecutors who quit the case — a move that was denied by Jackson. Stone will be offered the opportunity to challenge his sentence, which means he may not be immediately imprisoned.

Stone was arrested in Ft. Lauderdale, Florida, in January in a pre-dawn raid by the FBI. The raid drew condemnation from Republicans, including former Gov. Chris Christie (R-NJ), who said at the time that the FBI was “trying to intimidate” Stone with their use of AR-15s and flak jackets.

“I think it’s the wrong thing for prosecutors to do. I think that Mr. Mueller made a mistake in authorizing that because you’re going to be criticized,” Christie, a former federal prosecutor, said.