Attorney General William Barr, an outspoken proponent of conservative values and an expansive view of presidential power, will leave office before Christmas, President Trump announced in a tweet Monday afternoon.
Trump said he and Barr had a "very nice meeting" at the White House and that their "relationship has been a very good one."
Deputy Attorney General Jeff Rosen will become acting attorney general, Trump said.
In a letter to the president, Barr said he is proud to have played a role in Trump's administration and said he would depart Dec. 23.
Earlier this month, Barr said the Department of Justice found no evidence of widespread election fraud, directly contradicting Trump's baseless claims that Democrats stole the election. Ahead of the election, Barr had stood by the president, repeating his unsubstantiated claims that mail-in voting was ripe for fraud.
In less than two years on the job, Barr emerged as perhaps the most divisive attorney general in recent memory for a series of controversial actions, including his handling of special counsel Robert Mueller's report on the Russia investigation and his repeated false claims about the integrity of mail-in voting.
But his legacy will forever be stamped by his role leading the forceful removal of peaceful protesters from Lafayette Square in Washington, D.C., in the summer of 2020 to clear the way for a presidential photo-op in front of a nearby church.
Barr joined the administration halfway through the president's term and quickly emerged as one of Trump's most loyal and effective defenders. But he came under intense criticism from Democrats and many in the legal community — including even current federal prosecutors — for actions that raised questions about the department's independence.
Barr was nominated in late 2018 to replace Jeff Sessions, a former senator from Alabama whose time as attorney general was in large part defined by relentless attacks from Trump — in private and in public — because Sessions recused himself from the Russia investigation.
Trump considered that unforgivable and sought, but ultimately failed, to get Sessions to quash the investigation.
That was one reason why members of Congress viewed Barr — a prominent establishment Republican who had been attorney general once before under President George H.W. Bush — as a reassuring choice.
Republicans and Democrats alike had hopes that Barr could bring leadership and a steady hand to the department, which had found itself in the middle of Washington's brutal partisan battles since the 2016 election.
By and large, Barr leaves a department still enjoying strong support from Republicans. Senate Majority Leader Mitch McConnell, R-Ky., and Senate Judiciary Committee Chairman Lindsey Graham of South Carolina repeatedly made clear their strong support for him.
Barr's reputation on the other side of the aisle, however, is in tatters.
Democrats, after their initial cautious optimism, quickly soured on Barr.
That began with his handling of the rollout of Mueller's report on Russian interference in the 2016 election.
The report documented numerous contacts between Trump associates and Russians but said the facts gathered did not establish there was a conspiracy between the Trump campaign and the Kremlin. And Mueller's team did not draw a conclusion on whether the president obstructed justice.
Barr, however, did: He said there was no evidence of obstruction, effectively clearing the president of any wrongdoing at a time before the report was published.
Democrats accused Barr of baking in the "no collusion, no obstruction" narrative before anyone else had a chance to see Mueller's report.
Democrats were not alone in their criticism.
In March, U.S. District Judge Reggie Walton called Barr's handling of the Mueller report "distorted" and "misleading." Walton, a George W. Bush appointee who was presiding over a lawsuit seeking redacted portions of the Mueller report, said Barr's actions raised questions about the attorney general's credibility.
The Mueller report was just the beginning for Barr's critics.
Democrats bristled over Barr's statement that he believed the Trump campaign was "spied on" during the 2016 race, and his decision to appoint a veteran prosecutor, John Durham, to investigate the origins of the Russia probe.
All of that happened within the first few months of Barr's tenure, dissolving any benefit of the doubt Democrats — and many observers in the legal community — had given him.
Attorney for the president?
Barr drew fire for other decisions.
He didn't show up for a hearing before the House Judiciary Committee during a nadir in tensions with Democrats. The Justice Department initially didn't give Congress the whistleblower complaint that detailed many of Trump's actions in the Ukraine affair.
And Barr overruled career prosecutors in Washington, D.C., in the case of Trump adviser Roger Stone; Barr instructed them to ask for a lighter sentence.
He also intervened in the case against another former Trump insider, Michael Flynn. The former national security adviser pleaded guilty to lying to the FBI about his contacts with the Russian ambassador.
The Justice Department, with Barr's approval, moved to drop its prosecution of Flynn, although the presiding judge in the case balked. Ultimately, Trump pardoned Flynn the day before Thanksgiving.
The Stone and Flynn decisions prompted an outcry from legal experts and former federal prosecutors, and raised concerns about the politicization of the department under Barr's leadership.
Graham and other supporters said criticism over Barr's actions was unmerited and politically driven. Backers say he has not done anything outside the realm of what any other attorney general would do.
And ultimately it was not partisan battles with Democrats that ushered Barr out the door but instead his fraying relationship with the president.
For much of Barr's tenure, Trump singled him out for praise, calling Barr a "credible guy, tough guy" and a great attorney general.
But behind the scenes, Barr grew frustrated by the president's tweets and public statements about the department's ongoing cases, people close to Barr say. The attorney general was sensitive about the perception that he wasn't an independent officer but a political factotum of the president.
The public got its first glimpse of that in the uproar over Stone's sentencing recommendation.
Barr said he decided on his own to intervene after lower-level prosecutors submitted their sentencing recommendations in Stone's case. But at nearly the same time, Trump also complained about the case on Twitter — feeding suspicions that Barr was acting at the president's behest.
In an interview with ABC News a few days later, Barr said the president's tweets were making it "impossible" for him to his job. He urged the president to stop publicly discussing the department's work.
The president did not heed Barr's advice. In the days that followed, NPR learned that Barr told people around him he was considering quitting.
The two worked together through the tumultuous summer months, but the relationship unraveled after Trump's election loss to Joe Biden.
The president refused to acknowledge his defeat, and he and his campaign pushed baseless claims the vote had been stolen.
Nearly a month after the election, Barr told The Associated Press the Justice Department had found no evidence so far of any widespread fraud that would change the outcome of the election.
The remarks outraged Trump, who fired back that Barr "hasn't done anything" and "hasn't looked" for voter fraud. Asked whether he still had confidence in his attorney general, the president replied: "Ask me that in a number of weeks from now."