Trump ousting Secretary of State Rex Tillerson, to be replaced by CIA Director Mike Pompeo The move was first confirmed on Twitter.

President Donald Trump is firing Secretary of State Rex Tillerson, tweeting this morning that he plans to replace him with CIA Director Mike Pompeo.

Tillerson announced that he will delegate his official responsibilities to his deputy by the end of the day, though he will technically remain secretary through March 31.

Trump asked Tillerson to step aside Friday, a senior White House official initially told ABC News, but the State Department says Trump never spoke to Tillerson about the decision. The White House and State Department later clarified that Chief of Staff John Kelly spoke to Tillerson about the change Friday, with Tillerson saying in his first public comments today that he spoke to the president at around noon, more than three hours after Trump tweeted the announcement.

Explaining the move

Trump wanted to make sure he had a team in place before the recently announced talks with North Korean leader Kim Jong Un, the senior White House official told ABC News.

Trump believes he works well with Pompeo and the decision to replace Tillerson was not based on any single issue, the official said.

Trump, speaking briefly to reporters this morning before leaving for his trip to California, said he and Tillerson "disagreed on things.”

By contrast, Trump added, he and Pompeo are "always on the same wavelength" and "we have a very similar thought process."

"As far as Rex Tillerson is concerned, I very much appreciate his commitment and his service. He's a good man," Trump said.

"We got along quite well but we disagreed on things," he said, noting how he and Tillerson "felt a bit differently" on the Iran nuclear weapons deal.

"I actually got along well with Rex but really it was a different mindset. It was a different thinking," Trump said.

Tillerson and Trump have had tumultuous points in their relationship in the past. One public dispute came in October after reports that Tillerson called the president a "moron."

Trump released a lengthy statement praising Pompeo, 54, and his planned successor, Gina Haspel, concluding with two sentences about Tillerson.

"I want to thank Rex Tillerson for his service. A great deal has been accomplished over the last fourteen months, and I wish him and his family well," Trump said in the statement released by the White House.

Back and forth about who called when

Trump's first public comment on the cabinet shuffle came on Twitter at 8:44 a.m. when he wrote: "Mike Pompeo, Director of the CIA, will become our new Secretary of State. He will do a fantastic job! Thank you to Rex Tillerson for his service! Gina Haspel will become the new Director of the CIA, and the first woman so chosen. Congratulations to all!"

A senior White House official initially told ABC News that Trump told Tillerson about the change Friday, but shortly after, Steve Goldstein, the State Department's then-undersecretary for public diplomacy and public affairs, released a statement saying Tillerson did not speak directly to Trump.

"The secretary did not speak to the president and is unaware of the reason, but he is grateful for the opportunity to serve, and still believes strongly that public service is a noble calling," Goldstein said. "The secretary had every intention of staying because of the critical progress made in national security. He will miss his colleagues at the Department of State and the foreign ministers he has worked with throughout the world."

Goldstein was fired by the White House three hours after issuing that statement, which contradicted the White House's account of Tillerson's firing. Goldstein was the fourth-highest ranking official at the State Department.

The White House clarified that Kelly told Tillerson Friday he was going to be replaced.

In Tillerson's first public comments after the dismissal, he said he spoke to Trump at noon when the president was on board Air Force One en route to California.

How the past few days unfolded

Kelly spoke to Tillerson Friday March 9, informing him he would be dismissed but without clarifying when the official public announcement would be made.

Tillerson canceled events in Africa the following day, citing illness.

Tillerson had spent much of his trip to Africa trying to make up for Trump’s derogatory comments in January when he referred to certain African nations as “s---hole” countries.

On Sunday, March 11, the former ExxonMobil CEO had cut a trip to Africa short Monday, citing “the demands of work and the need to be in Washington for in-person meetings.”

And then on Monday, while on the plane back to the United States, Tillerson delivered one of the harshest public rebukes of Russia from a top official in the Trump administration, saying he has grown "extremely concerned about Russia."

Tillerson cited the poisoning of a former Russian spy in England, saying "this is very, very concerning to me" and adding the attack "certainly will trigger a response."

Tillerson's time at State

Tillerson's time at the State Department was rocky, often at odds with his boss and unpopular with many of his employees.

He tried to overhaul the agency’s bureaucracy with a “redesign” meant to bring it into the 21st century. While it included some popular changes like updating IT and HR systems, it also called for a hiring freeze, buyouts and eliminating many special envoy positions — all of which earned the ire of employees.

Tillerson also spent much of his time making up for or trying to explain Trump’s tweets and rhetoric, seeking to reassure nervous allies in Europe, Latin America and other parts of the world.

Some of the biggest achievements of Tillerson's tenure included the strengthening of the global pressure campaign against North Korea, which involved securing support not just from allies like China or Russia, but other countries in Africa and Asia.

Prior to today's announcement, Tillerson was also trying to build consensus with European partners on a new side deal to contain Iran’s ballistic missile program, with Latin American partners on an oil embargo on Venezuela, and with India, Australia and Japan on writing the rules of a free and open Indo-Pacific region. It’s unclear which of those will continue under Pompeo.

Tillerson, 65, took over as head of the State Department in February 2017. He is the second agency secretary to leave Trump’s Cabinet after former Health and Human Services Secretary Tom Price resigned in September over his use of private jets that were funded by taxpayer money.

Praising Pompeo

In addition to his laudatory comments about Pompeo to reporters before he departed for California, Trump also released a written statement praising his new pick for secretary of state.

"I have gotten to know Mike very well over the past 14 months, and I am confident he is the right person for the job at this critical juncture," Trump wrote.

Both he and Haspel, 61, require Senate confirmation.

Nikki Haley, the U.S. Ambassador to the United Nations, praised the decision on Twitter.

"Congratulations to my friend and soon to be Secretary of State Mike Pompeo! Great decision by the President," Haley wrote.