United States Attorney General William Barr took a rare public swipe at President Donald Trump on Thursday, saying that the president's tweets about Justice Department prosecutors and cases "make it impossible for me to do my job".

Barr made the comment during an interview with ABC News just days after his Justice Department overruled its own prosecutors, who had recommended in a court filing that Trump's longtime ally and confidant Roger Stone be sentenced to seven to nine years in prison, by taking the extraordinary step of lowering the amount of prison time it would seek. The department did not offer an amended number.

Barr himself has been under fire for the Justice Department action and Thursday's comment served as a defence of his own integrity.

More:

The department insisted the decision to undo the sentencing recommendation was made on Monday night - before Trump blasted the recommendation on Twitter as "very horrible and unfair" - and prosecutors had not spoken to the White House about it. The about-face prompted the four lawyers who prosecuted Stone to quit the case. One left the Justice Department altogether.

This is a horrible and very unfair situation. The real crimes were on the other side, as nothing happens to them. Cannot allow this miscarriage of justice! https://t.co/rHPfYX6Vbv — Donald J. Trump (@realDonaldTrump) February 11, 2020

"I'm happy to say that, in fact, the president has never asked me to do anything in a criminal case," Barr said in the interview. "However, to have public statements and tweets made about the department, about our people in the department, our men and women here, about cases pending in the department, and about judges before whom we have cases, make it impossible for me to do my job and to assure the courts and the prosecutors in the department that we're doing our work with integrity."

Stone was convicted in November of tampering with a witness and obstructing the House investigation into whether the Trump campaign coordinated with Russia to tip the 2016 election. He is scheduled to be sentenced next week.

Barr said he was "of course" prepared to deal with any ramifications from the president for his comments.

"As I said during my confirmation, I came in to serve as attorney general. I am responsible for everything that happens in the department, but the thing I have most responsibility for are the issues that are brought to me for decision," Barr said in the interview.

Roger Stone exiting federal court in Washington, DC [File: Julio Cortez/ AP Photo ]

It is extremely rare for Justice Department leaders to reverse the decision of prosecutors on a sentencing recommendation, particularly after that recommendation has been submitted to the court. The actual sentencing is up to the judge.

"What they did to Roger Stone was a disgrace," Trump said Thursday during an interview with Geraldo Rivera on Newsradio WTAM1100.

"I don't think they quit the case. I think they felt they got caught," the president said of the Stone prosecutors. "I don't think they quit for moral reasons. I think they got caught in the act by me."

"Now, what am I going to do, sit back and let a man go to jail maybe for nine years when murderers aren't going to jail? You have some of the most serious horrible rapists and everything else. They don't go to jail for nine years," Trump said.

In an unusual public statement on Thursday Chief Judge Beryl Howell said that public criticism "is not a factor" in sentencing decisions.

"The Judges of this Court base their sentencing decisions on careful consideration of the actual record in the case before them; the applicable sentencing guidelines and statutory factors; the submissions of the parties, the Probation Office and victims; and their own judgment and experience," Howell said. "Public criticism or pressure is not a factor."

Democrats decried the Justice Department's reversal and called for immediate investigations. Senate Minority Leader Chuck Schumer called for the Justice Department's inspector general to step in and open an investigation. House Speaker Nancy Pelosi said Thursday that Barr had "stooped to such levels" and that "the American people deserve better."

"What a sad disappointment to our country," she said.

Barr has been a steadfast ally of the president's since he returned to the top post at the Justice Department last year. He cleared the president of obstruction of justice even when special counsel Robert Mueller had pointedly declined to do so, and has declared that the FBI's Russia investigation, which resulted in charges against Stone, had been based on a "bogus narrative".