US Attorney General William Barr has said he is considering quitting his post after President Donald Trump ignored his warning to stop tweeting about Justice Department cases, according to a Trump administration official.

The official told The Associated Press Mr Barr made his comments to friends.

The revelation came days after Mr Barr took a public swipe at the president, saying in a television interview Mr Trump’s tweets about Justice Department cases and staffers had made it “impossible” for him to do his job.

The next day, Mr Trump ignored Mr Barr’s request and insisted he had the “legal right” to intervene in criminal cases and sidestep the Justice Department’s historical independence.

Mr Trump tweeted on Tuesday he was considering suing those involved in 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.

Mr Barr, serving in his second stint as attorney general, sought to paint himself as an independent leader who would not bow to political pressure.

But Democrats have repeatedly accused Mr Barr of acting more like the president’s personal attorney than the attorney general.

Mr Barr has proved to be a largely reliable Trump ally and defender of presidential power.

In recent days, a stream of Trump allies, including South Carolina Republican senator Lindsey Graham, have issued statements expressing their confidence in the attorney general.

The revelation about Mr Barr’s comments came on a day in which Mr Trump drew more for granting clemency in the cases of 11 people jailed in the US, an action critics said involved granting rewards to some of his friends.