The attorney general, William Barr, has told people close to him he is considering quitting his post, after Donald Trump failed to heed his warning to stop tweeting about justice department cases, administration officials told the Washington Post and Associated Press.

The revelation came days after Barr took a public swipe at the president, saying in a television interview that Trump’s tweets about justice department cases and staffers made it “impossible” for him to do his job. The next day, Trump ignored Barr’s request and insisted that he had the “legal right” to intervene in criminal cases and sidestep the department’s historical independence.

Trump tweeted on Tuesday that he was considering suing those involved in the special counsel Robert Mueller’s Russia investigation and opined that his confidant Roger Stone deserved a new trial after being convicted of witness tampering and obstruction.

William Barr: how the attorney general became Trump's enabler-in-chief Read more

The president also claimed, falsely, that he was “the chief law enforcement officer” of the US. In fact, as attorney general, Barr is the chief law enforcement officer in the federal government.

Barr, serving his second stint as attorney general, has sought to paint himself as an independent leader who will not bow to political pressure. But Democrats have repeatedly accused him of acting more like the president’s personal attorney than the attorney general. Barr has proved to be a largely reliable Trump ally and defender of presidential power.

A week ago, after Trump tweeted criticism of federal prosecutors’ recommendation that Stone should be sentenced to seven to nine years in prison, Barr intervened and reduced the recommendation. Barr’s claim that he had decided to make the change before Trump weighed in was met with skepticism. Four career prosecutors quit the case as a result; one of them left the federal government entirely.

Over the weekend, 2,000 former justice department employees signed a letter urging Barr to resign over his handling of the Stone case. In response, a stream of Trump allies, including Senator Lindsey Graham, a South Carolina Republican, have issued statements expressing their full confidence in the Barr. But Trump has a low tolerance for criticism, especially public criticism, from his allies and often fires back in kind.

Trump conceded to reporters earlier on Tuesday that he did make Barr’s job “harder” but said he had “total confidence” in his attorney general. It is unclear whether Barr has made Trump aware that he is considering leaving his post, or how seriously he is considering leaving.