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

»NEW DETAILS: Uproar in Washington after lighter sentence sought for Trump ally

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 — and took the extraordinary step of lowering the amount of prison time it would seek.

At the White House on Thursday, top aides reportedly informed Trump about Barr's comments.

CNN correspondent Jim Acosta and others reported that Trump was not upset with Barr.

Barr has been under fire for the Justice Department action, and Thursday’s comment served as a defense of his own integrity. He is a Trump loyalist who shares the president’s views on expansive executive powers.

The remarks, made so quickly after the decision to back away from the sentencing, suggested Barr was aware the reversal had chipped away at the department’s historic reputation for independence from political sway. But he stopped short of acknowledging wrongdoing by anyone.

There was no immediate response from the White House, but the Trump administration reportedly was crafting a “statement,” according to reporter Brian J. Karem.

Barr said Trump’s tweets created perception problems for the department that called into question its independence, but he denied there was any order from Trump and said Trump’s tweets did not factor into the decision.

Barr joined a roster of high-level aides who have publicly criticized Trump, with the key difference that he is still in his job. Former national security adviser John Bolton is to publish a book next month detailing his time in the White House including criticism of Trump actions such as his decision to withhold military assistance while seeking a political favor from Ukraine. Former chief of staff John Kelly, who has largely kept a low profile since leaving the White House, has grown more open about his unflattering assessments of the president.

Earlier this week, Trump applauded Barr on Twitter for the decision to reverse the sentencing recommendation, writing: “Congratulations to Attorney General Bill Barr for taking charge of a case that was totally out of control and perhaps should not have even been brought.”

The department insisted the decision to undo the sentencing recommendation was made 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 attorneys who prosecuted Stone to quit the case. One left the Justice Department altogether.

“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 ABC 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’s 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.

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.

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 steady 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.”