Attorney General William Barr, the head of the Department of Justice, will leave office before Christmas, President Donald Trump said Monday.

The widely anticipated announcement of Barrs departure came just moments after President-elect Joe Bidens victory over Trump was formalized by the Electoral College. The shake-up, in the twilight of Trumps tenure in the White House, also followed weeks of public clashes between Barr and the president.

But Barrs resignation letter, shared on Twitter by Trump as he made the announcement, elaborately praised the president and said he felt proud to have played a role in the many successes and unprecedented achievements you have delivered for the American people.

Your record is all the more historic because you accomplished it in the face of relentless, implacable resistance, Barrs letter reads. Few could have weathered these attacks, much less forge ahead with a positive program for the country.

Trump, in the tweets, also implied he bore no ill will toward Barr, despite his recent criticisms.

Just had a very nice meeting with Attorney General Bill Barr at the White House, Trump said in a pair of tweets. Our relationship has been a very good one, he has done an outstanding job!

Deputy Attorney General Jeff Rosen will serve as acting attorney general following Barrs departure, Trump said in the tweets. Richard Donoghue, former U.S. Attorney for the Eastern District of New York, will take over Rosens role as the No. 2 official at the Justice Department, Trump wrote.

Barr in early December directly contradicted Trump when he revealed that the Department of Justice had not found any evidence of large-scale voter or election fraud that would overturn Bidens projected victory.

That admission during an interview with the Associated Press undercut the president, who has refused to concede to Biden and is falsely claiming he won the election, citing an array of unproven fraud conspiracies and asserting the race was rigged against him.

The statements from Barr also sharply undermined the legal efforts from lawyers on the Trump campaign to reverse Bidens wins in key swing states.

William Barr takes a seat after a break in his Senate Judiciary Committee hearing on his nomination to be attorney general of the United States on Capitol Hill in Washington, U.S., January 15, 2019.

Yuri Gripas | Reuters

That legal team, led by Trumps personal attorney, Rudy Giuliani, has filed a series of lawsuits attempting to invalidate hundreds of thousands of votes, with a specific focus on counties that leaned heavily Democratic in the presidential election. Many of those long-shot lawsuits have already been rejected, and none so far have swayed swing-state judges to block or nullify the certification of Bidens wins.

Following the Electoral College vote earlier Monday, any remaining efforts to undo Bidens victory became significantly less likely to succeed.

Giuliani and another Trump campaign lawyer, Jenna Ellis, had pushed back on Barrs remarks after they were made public.

With all due respect to the Attorney General, there hasnt been any semblance of a Department of Justice investigation, Giuliani and Ellis said in a joint statement released by the Trump campaign at the time.

Again, with the greatest respect to the Attorney General, his opinion appears to be without any knowledge or investigation of the substantial irregularities and evidence of systemic fraud, the statement said.

Later in December, Trump voiced frustration with the Justice Department for refusing to make public its investigations involving Bidens son, Hunter Biden, in the runup to the election.

The Wall Street Journal reported that Barr had worked to conceal the probes involving Hunter Bidens business dealings and finances during the election season, despite pressure from Trump and Republicans seeking information on the Democratic nominees son.

Trump on Dec. 11 tweeted, Why didnt the Fake News Media, the FBI and the DOJ report the Biden matter BEFORE the Election.

He falsely added: Oh well, its OK, we won the Election anyway - 75,000,000 VOTES!!!

On Saturday, Trump retweeted a post that said Barr should be fired by the end of business today if the attorney general had worked to keep a criminal investigation of Hunter Biden secret during the election, as The Wall Street Journal reported Friday.

A big disappointment! Trump wrote in a comment on that post.

Barrs ouster deepens an ongoing leadership crisis at the Justice Department. The attorney general had faced intense criticism, including from current and former DOJ officials, that he had politicized the department.

Barr raised hackles through his interventions in a number of high-profile federal cases involving Trumps allies.

After federal prosecutors suggested a harsh prison term for GOP operative Roger Stone, a friend of Trumps who had been convicted of seven felonies related to lying to Congress, Barr stepped in to lighten that proposed sentence. Four of the federal attorneys on Stones case quit the prosecution shortly thereafter. Trump in July commuted Stones sentence, sparing him from entering prison.

Barr also faced scrutiny over his handling of former special counsel Robert Muellers report on Russian interference in the 2016 election, as well as the termination of Geoffrey Berman, the former U.S. Attorney for the Southern District of New York. 

At times, however, Barr publicly pushed back on Trump. In one interview, Barr complained that some of the presidents tweets about ongoing cases made it impossible for him to do his job.

A more recent controversy involved an embarrassing mix-up over the replacement of the former U.S. attorney in Manhattan.

In June, Barr announced that Berman was stepping down, and that he would be replaced by Securities and Exchange Commission Chair Jay Clayton.

Berman, who was reportedly investigating Trumps lawyer Giuliani, fired back hours later that he had not resigned and would not step down until Trump formally nominated a replacement and that person received Senate confirmation. 

Berman ultimately stepped aside after Barr said that he would be replaced on an acting basis by Bermans deputy, Audrey Strauss. 

The end of Barrs tenure is the final step in the deterioration of Trumps relationship with his attorney general, an alliance that was once considered to be among the strongest Trump had with any member of his Cabinet.

Barrs role in the Trump administration, which he took on in 2019, marked his second stint as the nations highest law enforcement official. Barr also served as attorney general under President George H.W. Bush in the 1990s.  

— CNBCs Dan Mangan contributed to this report.

Reach out

Find us at the office

Exel- Frazzitta street no. 61, 44925 Kingston, Norfolk Island

Give us a ring

Jovanny Boeding
+23 274 947 142
Mon - Fri, 10:00-21:00

Tell us about you