WASHINGTON — President Trump said on Monday that Attorney General William P. Barr would depart next week, ending a tenure marked by Mr. Barr’s willingness to advance the president’s political agenda and by criticism that he eroded the post-Watergate independence of the Justice Department.
Mr. Barr had in recent weeks fallen out of favor with the president after acknowledging that the department had found no widespread voter fraud. Tensions between them escalated this past weekend when Mr. Trump accused his attorney general of disloyalty for not publicly disclosing the department’s investigation into President-elect Joseph R. Biden Jr.’s son Hunter Biden during the campaign.
Mr. Trump sought to play down their differences on Monday, saying in a tweet announcing Mr. Barr’s departure that “our relationship has been a very good one, he has done an outstanding job!” The decision to quit was Mr. Barr’s, not the president’s, a person familiar with the matter said, and the White House counsel, Pat A. Cipollone, helped to facilitate his exit on cordial terms with Mr. Trump.
Mr. Barr reciprocated the praise in a resignation letter devoted to commending Mr. Trump’s term, saying that the Justice Department was pursuing some accusations of voter fraud and mentioning that he and the president had met on the issue on Monday afternoon. A Justice Department spokeswoman declined to elaborate on its work on the accusations or how it fit with Mr. Barr’s earlier assertions that it had found no evidence of widespread voter fraud.
Still, Mr. Barr’s resignation allows him to avoid further confrontation with the president over his refusal to advance Mr. Trump’s attempts to rewrite the election results or his efforts to interfere in criminal inquiries into Mr. Biden’s family.
Mr. Barr also praised Mr. Trump in the letter for overcoming what the attorney general said was an unprecedented effort by his political opponents to take down the president.
“No tactic, no matter how abusive and deceitful, was out of bounds,” Mr. Barr said. “The nadir of this campaign was the effort to cripple, if not oust, your administration with frenzied and baseless accusations of collusion with Russia.”
Jeffrey A. Rosen, the No. 2 at the Justice Department, will take over as acting attorney general when Mr. Barr leaves on Dec. 23. Richard Donoghue, an official in Mr. Rosen’s office, will become the deputy attorney general.
Though Washington has been abuzz with rumors about the fate of Mr. Barr’s post, Republicans said they were surprised by his abrupt departure.
Mr. Barr “did an incredibly good job trying to repair damage to our Department of Justice, trying to be fair and faithful to the law, and I think he’s got a lot to be proud of,” Senator Lindsey Graham, Republican of South Carolina and a close ally of Mr. Trump’s, told reporters who informed him of the news.
Mr. Barr, 70, who also served as attorney general in the George Bush administration, was viewed initially in Washington as a possible stabilizing force in the chaotic Trump era, but that expectation dissipated as he took aim at the Justice Department’s own investigation into the Trump campaign’s ties to Russia that had long antagonized the president.
Mr. Barr brought the Justice Department closer to the White House than any attorney general in a half-century. Defying the distance that federal law enforcement officials have typically maintained from campaign politics, Mr. Barr spent the months leading up to the election echoing Mr. Trump’s unsubstantiated claims of widespread voter fraud. He also told an interviewer that the country would be “irrevocably committed to the socialist path” if the president were not re-elected.
But Mr. Barr backed off the warnings of voter fraud after the election, saying little publicly for weeks until he said that the department had received no evidence that would overturn Mr. Biden’s election. “To date, we have not seen fraud on a scale that could have effected a different outcome in the election,” Mr. Barr told The Associated Press.
Mr. Trump was livid over Mr. Barr’s refusal to endorse his increasingly specious claims of voting irregularities, and he has also become focused on whether any scrutiny of Hunter Biden was an issue that could have swayed voters, advisers said. The president has told aides he would like to see a special counsel appointed to oversee the investigation into Hunter Biden. It was not clear whether Mr. Barr was willing to do so, and a Justice Department spokeswoman declined to comment.
When The Wall Street Journal reported late last week that Mr. Barr had fought to keep the public from learning of the Justice Department’s investigations into Hunter Biden, following policy, it became clear that the attorney general could not stay in the post, advisers to Mr. Trump said.
The recent string of departures from the president’s views were rare for Mr. Barr, who had worked from the start to advance Mr. Trump’s political agenda by undermining the most significant conclusions of the Russia investigation. Weeks after taking office, he released a summary of the report by the special counsel, Robert S. Mueller III, that a judge later called distorted and misleading, and he held a news conference just before the full report was released where he described it in the best possible light for Mr. Trump.
Mr. Barr appointed a special prosecutor, John H. Durham, to inspect whether the inquiry was wrongfully opened, and he sought the withdrawal of the prosecution of Michael T. Flynn, the president’s first national security adviser. He overruled prosecutors who requested a tough sentencing recommendation for Roger J. Stone Jr., one of Mr. Trump’s longtime advisers.
Mr. Trump also handed him sweeping declassification powers to learn about any intelligence gathered in 2016 about Russia’s election interference, giving Mr. Barr leverage to root around at the C.I.A. and other intelligence agencies.
His tenure prompted a handful of career prosecutors to publicly criticize him, highly unusual actions that flouted Justice Department rules prohibiting employees from publicly discussing delicate internal matters.
“Prosecutors are supposed to do their jobs without regard to party or politics,” Michael Dion, a prosecutor in Seattle, wrote in a letter to the editor in The Seattle Times. “Barr, however, is turning the Justice Department into a shield to protect the president and his henchmen.”
Representative Jerrold Nadler, Democrat of New York and the chairman of the House Judiciary Committee, said Monday that Mr. Barr had misled the American public while attorney general and damaged the department in myriad ways.
“Whomever Joe Biden chooses as the new attorney general will have a tremendous amount of work to do to repair the integrity of the Department of Justice,” Mr. Nadler said in a statement. “The work must begin without delay.”
Mr. Barr took over the Justice Department after the president forced out Jeff Sessions as attorney general in November 2018, reassuming a position Mr. Barr held roughly a quarter of a century ago under President George Bush. He quickly became one of the most powerful members of Mr. Trump’s cabinet.
He swiftly used his discretion to disclose nearly all of a 448-page report by Mr. Mueller on Russian interference in the 2016 election. That decision gave some critics of Mr. Trump hope that the new attorney general would help curb the president’s excesses and protect the department from political interference.
But that faded as Mr. Barr made decisions that dovetailed precisely with Mr. Trump’s wishes and the demands of his political allies. In ever stronger terms, he attacked the F.B.I.’s investigation, instigating first a review, then a criminal inquiry. Like the president himself, he suggested the inquiry was an abuse of the F.B.I.’s power.
“The question really is, what was the agenda after the election that kept them pressing ahead after their case collapsed? Mr. Barr said last December. “He’s the president of the United States.”
Independent reviews have found that investigators opened the Russia inquiry without political bias. The investigation uncovered an elaborate Russian campaign to sabotage the 2016 election, the president’s repeated efforts to thwart the inquiry and the Trump campaign’s expectation that it would benefit from the Kremlin operations.
After a scathing report by the inspector general illuminated serious omissions and errors in one narrow aspect of the inquiry, the F.B.I.’s applications for warrant to wiretap the onetime Trump campaign adviser Carter Page, Mr. Barr imposed new restrictions on inquiries directed at presidential campaigns, requiring his personal approval of any inquiry into a 2020 presidential candidate.
He exerted his influence with the president multiple times to preserve the job of the F.B.I. director, Christopher A. Wray, whom Mr. Trump has expressed displeasure with over the Russia investigation and other issues.
Before his dismissal of voter fraud claims, Mr. Barr’s most prominent break from the president came during the fight over Mr. Stone’s sentencing recommendation. After prosecutors recommended that Mr. Stone be imprisoned for seven to nine years for obstructing a congressional inquiry that threatened to embarrass the president, Mr. Trump publicly called it “horrible and very unfair.”
Mr. Barr’s intervention hours later prompted widespread criticism that the Justice Department was bending to White House pressure. In an effort to quell the criticism, Mr. Barr publicly responded that Mr. Trump’s comments made his job “impossible” by impairing his ability to act without facing accusations of bowing to political interference.
Mr. Trump rebuffed him, continuing to assail the criminal prosecution of Mr. Stone and other issues related to the Russia investigation. But he did not fire Mr. Barr, who was also said to have considered resigning. Some suggested the president had mollified him by agreeing not to cite him in a way that made it seem like he was simply Mr. Trump’s lackey.
An unusually strong advocate of expansive presidential powers, Mr. Barr asserted that the administration had a wide legal berth to fight congressional subpoenas. His broad view of the executive branch’s authority, well known before Mr. Trump appointed him, made him a favorite target for Democrats in Congress. But it endeared him to some Republicans, and to the president, who had publicly complained that Mr. Sessions was too weak to stand up for him for months before he fired him.
Emily Cochrane and Maggie Haberman contributed reporting.