In a surprise announcement, President Donald Trump tweeted Friday that Rep. Mark Meadows (R-N.C.) is his new White House chief of staff.

He also thanked his outgoing acting White House chief of staff, Mick Mulvaney, for serving the administration “so well.” Mulvaney will be named the U.S. special envoy for Northern Ireland, the president added.

I am pleased to announce that Congressman Mark Meadows will become White House Chief of Staff. I have long known and worked with Mark, and the relationship is a very good one.... — Donald J. Trump (@realDonaldTrump) March 7, 2020

....I want to thank Acting Chief Mick Mulvaney for having served the Administration so well. He will become the United States Special Envoy for Northern Ireland. Thank you! — Donald J. Trump (@realDonaldTrump) March 7, 2020

Meadows has been an ally of Trump since the 2016 presidential campaign. But he also drew Trump’s ire during the early days of the GOP efforts to repeal and replace Obamacare.

Meadows, as the chairman of the conservative House Freedom Caucus at the time, ultimately convinced Trump and Republican leadership to pursue a bill that would have undermined protections for people with preexisting conditions. With those changes, Meadows was instrumental in getting the bill to pass the House in 2017.

Meadows has remained in frequent contact with Trump ever since, and he was a major defender of the president during the impeachment trial.

Mulvaney, who is also stepping down from his job as head of the Office of Management and Budget, has been a staunch Trump loyalist. The president named the former Republican congressman acting White House chief of staff in December 2018 to replace John Kelly, hailing Mulvaney as a “great patriot.”

Mulvaney and Secretary of State Mike Pompeo were reportedly key players in Trump attorney Rudy Giuliani’s attempt to pressure Ukraine into launching an investigation into former Vice President Joe Biden and his son, an operation that ultimately led to Trump’s impeachment. Mulvaney insisted that the investigation was intended to expose Ukraine, not Russia, as the nation that interfered with the 2016 presidential election, a conspiracy theory that runs counter to U.S. intelligence findings.

But Mulvaney has also caused trouble for the president, particularly when he admitted there was a quid pro quo conditioning U.S. military aid to Ukraine on an investigation into the Bidens. “Get over it,” Mulvaney told reporters. “There’s going to be political influence in foreign policy ... That is going to happen. Elections have consequences.”

"To be clear, what you described is a quid pro quo" -- Here's Mick Mulvaney casually admitting that Trump held up aid to Ukraine as leverage to get the Ukrainian government to investigate the 2016 election pic.twitter.com/ylz7BKEmKd — Aaron Rupar (@atrupar) October 17, 2019

There were rumors then that Mulvaney would be ousted, but he was able to hang on for months longer.

Mulvaney also, inexplicably, said in a speech at the Oxford Club in England last month that the U.S. is in “desperate” need of more immigrant workers for economic growth — even as his boss has continued to crack down on immigrants.

In recent days, Trump grew fond of the idea of replacing Mulvaney with Meadows, calling Meadows on Thursday to discuss the appointment, according to sources.

This is a developing story. Please check back for updates.