William Barr has told people close to Donald Trump - inside and outside the White House - that he is considering quitting his role as US attorney general over Mr Trump's tweets about Justice Department investigations, three administration officials said, foreshadowing a possible confrontation between the president and Mr Barr over the independence of the Justice Department.

So far, Mr Trump has defied Mr Barr's requests, both public and private, to keep quiet on matters of federal law enforcement. It was not immediately clear whether Mr Barr had made his posture known directly to Mr Trump. The administration officials said Mr Barr seemed to be sharing his position with advisers in hopes that the president would get the message that he should stop weighing in publicly on the Justice Department's ongoing criminal investigations.

“He has his limits,” said one person familiar with Mr Barr's thinking, speaking on the condition of anonymity, like others, to discuss internal deliberations.

Late last week, Mr Barr publicly warned the president in a remarkable interview with ABC News that his tweets about Justice Department cases “make it impossible for me to do my job”. Mr Trump, White House officials said, is not entirely receptive to calls to change his behaviour, and he has told those around him he is not going to stop tweeting about the Justice Department. They said Mr Trump sees highlighting FBI and Justice Department misconduct as a good political message.

The standoff between Mr Trump and Mr Barr intensified on Tuesday, when Mr Trump declared in a string of early morning tweets that he might sue those involved in the special counsel's investigation into his 2016 campaign and suggested that Roger Stone, his friend convicted of lying to congress in that probe, deserved a new trial.

Everyone Trump has fired or forced out Show all 13 1 /13 Everyone Trump has fired or forced out Everyone Trump has fired or forced out John Bolton Trump claimed to have fired Bolton, his national security adviser, while Bolton claimed he offered to resign. An anonymous White House source that Bolton's departure came as a result of the national security adviser working too independently of the president AFP/Getty Everyone Trump has fired or forced out Anthony Scaramucci Scaramucci lasted only six days in his role as Trump's communications director before being fired by John Kelly, the incoming chief of staff Getty Everyone Trump has fired or forced out Rick Perry Rick Perry announced his resignation just as he became embroiled in the president's impeachment scandal. The White House said Mr Perry was asked by Donald Trump to work with Rudy GIuliani in regards to Ukraine. AP Everyone Trump has fired or forced out Rex Tillerson Tillerson, Trump's first secretary of state, was fired after a series of clashes with the president over policy Getty Everyone Trump has fired or forced out James Mattis Mattis served as secretary of defense from the beginning of Trump's administration until retiring on 1 January 2019. However, the president later claimed that he had "essentially fired" Mattis Getty Everyone Trump has fired or forced out James Comey Comey was fired as director of the FBI early in Trump's presidency after serving in the role for four years prior. His dismissal is widely thought to have been related to the Russia investigation Getty Everyone Trump has fired or forced out Reince Priebus Priebus, Trump's first chief of staff, was forced out after six tumultuous months AFP/Getty Everyone Trump has fired or forced out David Shulkin Veterans affairs secretary Shulkin claims that he was fired, the White House claims that he resigned Getty Everyone Trump has fired or forced out John Kelly Kelly, Trump's second chief of staff, was forced out after 17 months in office. His departure was a confused affair though it is clear that Trump wanted Kelly out AFP/Getty Everyone Trump has fired or forced out Michael Flynn Flynn lasted 24 days as Trump's national security adviser before being fired for lying to the FBI Getty Everyone Trump has fired or forced out Lee Cisna Cisna served as director of citizen and immigration services between October 2017 and June 2019 before being asked to resign amid a major personnel change in the department of homeland security Everyone Trump has fired or forced out Madeline Westerhout Westerhout served as Trump's personal assistant after leaking private information about his family AFP/Getty Everyone Trump has fired or forced out Mira Ricardel Ricardel was forced out of her role as Deputy National Security Advisor after first lady Melania Trump publicly called for her to be fired

Hours later, a Justice Department official revealed that prosecutors had filed a sealed motion in court arguing the opposite, and that they had Mr Barr's personal approval to do so.

Mr Barr had a previously scheduled lunch with the White House counsel on Tuesday and was still the attorney general by day's end - indicating that the president's moves that day were not enough to push him to resign. But he and his Justice Department seemed to remain mired in a political crisis, with an uncertain future.

A Justice Department spokesperson declined to comment. White House representatives did not respond to questions for this report. Some people familiar with Mr Barr's thinking cautioned that he would not make a hasty decision to leave, and it is unclear what precisely would trigger him to take such a dramatic step.

It was only a week ago that Mr Trump's tweet about federal prosecutors' recommendation that Mr Stone should be sentenced to seven to nine years in prison sent the Justice Department into a tailspin.

After that tweet, Mr Barr moved to intervene and lower the recommendation. The four career prosecutors assigned to the matter quit the case, with one leaving the government entirely. Mr Barr has insisted that he made up his mind to get involved before Mr Trump weighed in, but he faced significant scepticism inside and outside the Justice Department.

Over the weekend, more than 2,000 former department employees signed a public letter urging Mr Barr to resign over his handling of the Stone case and exhorted current department employees to report any unethical conduct. Jan Miller, who was the US attorney for Central Illinois from 2002 until 2005 under George W Bush, said he signed in part to remind rank-and-file Justice Department employees “they're not alone”.

“I'm sure it's a very difficult time to be a line prosecutor in the department right now,” Mr Miller said.

White House press secretary Stephanie Grisham downplayed the letter's significance, saying there were “obstructionists all across this government who are working against the president”. Senate majority leader Mitch McConnell and judiciary chairman Lindsey Graham also came to Mr Barr's defence in a joint statement.

“The nation is fortunate that president Trump chose such a strong and selfless public servant to lead the Department of Justice,” they wrote. “We expect that, as always, efforts to intimidate the attorney general will fall woefully short.”

People close to Mr Barr say he is unlikely to be moved by the letter, which bears the signatures of many who have long been vocal opponents of his. But Mr Barr, the people said, is deeply concerned about morale inside the department, and that is in part why he chastised the president publicly in an interview with ABC News.

In the weeks before the interview, Mr Barr had also privately told the president to stop speaking publicly on Justice Department matters, a person familiar with their discussions said. But his comments have apparently fallen on deaf ears. The next day, Mr Trump tweeted that he had the “legal right” to ask Mr Barr to intervene in a criminal case.

Mr Trump said on Tuesday that he has “total confidence” in Mr Barr and conceded: “I do make his job harder.” He also asserted, though, that he, rather than his attorney general, is “the chief law enforcement officer of the country”.

“The attorney general is a man with great integrity,” Mr Trump said. “I chose not to be involved. I'm allowed to be involved. I could be involved if I want to be.”

Mr Trump has raged privately for months over the Justice Department not charging those he considers political foes, and people familiar with the matter say he is particularly upset by the decision revealed last week not to charge former acting FBI director Andrew McCabe with lying to investigators exploring a media disclosure.

Mr McCabe authorised the FBI to begin investigating Mr Trump personally in 2017 for a possible obstruction of justice in connection with the probe into whether his campaign coordinated with Russia and suggested he might sue those involved. That case was ultimately taken over by special counsel Robert Mueller.

Mr Trump also has complained to associates that he has not been able to view the findings of John Durham, a federal prosecutor, whom Mr Barr tasked with examining the Russia probe's origins. Mr Durham's probe is ongoing, and he has not yet prepared any report detailing his conclusions, a person familiar with the matter said.

People familiar with the matter said Mr Trump has no plans to remove Mr Barr as attorney general, despite his frustrations. Apart from his ABC News interview, Mr Barr has been a particularly loyal and effective cabinet secretary for Mr Trump, willing to take political heat for the president.

Mr Barr absorbed significant criticism for how he cast the findings of Mr Mueller's investigation in a way that some saw as overly favourable to Mr Trump, and for commissioning internal Justice Department reviews of politically sensitive matters, including the Russia probe, that Mr Trump opposed.

But Mr Barr has been persistently vexed by Mr Trump's tweets, and he saw the president's commentary on Mr Stone last week as something of a last straw.

Mr Trump had largely refrained from law enforcement commentary over the weekend before erupting once more on Tuesday morning. The president quoted at length Andrew Napolitano, a former New Jersey Superior Court judge and Fox News commentator who, by Trump's telling, argued that Stone should receive a new trial based on “the unambiguous & self outed bias of the foreperson of the jury.”

“Pretty obvious he should (get a new trial),” Mr Trump quoted Mr Napolitano as saying.

Mr Trump also reprised old attacks on the Mueller investigation.

“The whole deal was a total SCAM. If I wasn't President, I'd be suing everyone all over the place,” Mr Trump wrote. “BUT MAYBE I STILL WILL. WITCH HUNT!”

Ms Grisham, the White House press secretary, said on Tuesday that “the president's obviously frustrated”.

“For three years he has been under attack in one way or the other, and the Mueller report is another example of that,” Ms Grisham said during an appearance on Fox & Friends, during which she also alluded to the Stone case. “I mean the foreperson of a jury was somebody who was very vocal about not liking president Trump or his supporters . . . That's scary stuff.”

The tweets came just before prosecutors and defence attorneys convened for a hearing in the Stone case to determine whether Mr Stone's request for a new trial needed to be resolved before his sentencing, scheduled for Thursday. Mr Stone's team had demanded the new trial Friday, one day after Mr Trump suggested that the foreperson in the federal case had “significant bias”.

Mr Trump was referring to Tomeka Hart, a former president of the Memphis City Schools Board of Commissioners and an unsuccessful Democratic candidate for congress. Ms Hart has identified herself as the forewoman of the jury in a Facebook post, saying she “can't keep quiet any longer” in the wake of a Justice Department move to reduce its sentencing recommendation for Mr Stone.

US district judge Amy Berman Jackson, who is presiding over Mr Stone's case, decided that Mr Stone will be sentenced on Thursday, though the “execution of the sentence will be deferred” while she decides whether Mr Stone deserves a new trial. The Justice Department is notably opposing Mr Stone in that matter - with Mr Barr's approval - and a Justice Department official said that decision “was made independent of the White House”.

Mr Trump told reporters on Tuesday that he thought Mr Stone had been “treated unfairly” but that he had not given any thought to issuing him a pardon. Mr Trump did issue pardons to several others on Tuesday, including Rod Blagojevich, the former Illinois governor who was convicted in 2011 on corruption charges related to trying to sell then-president Barack Obama's vacated Senate seat, and Bernard Kerik, the former New York police commissioner jailed on eight felony charges, including tax fraud.

Asked whether Mr Stone deserves any prison time, Mr Trump demurred, saying: “You're going to see what happens.”

Mr Stone has been a friend and adviser to Mr Trump since the 1980s and was a key figure in his 2016 campaign, working to discover damaging information on Democratic opponent Hillary Clinton.

A jury convicted Mr Stone in November on charges of witness tampering and lying to congress about his efforts to gather damaging information about Ms Clinton. His was the last conviction secured by Mr Mueller as part of his investigation into Russian interference in the 2016 election.

Mr Stone's defence has asked for a sentence of probation, citing his age, 67, and lack of criminal history.