WASHINGTON — After 14 months of private tensions and public disputes, President Donald Trump on Tuesday ousted his beleaguered secretary of state, replacing Rex Tillerson with CIA Director Mike Pompeo in a major shake-up of his national security and foreign policy team.


Trump announced the change in a Twitter message hours after Tillerson abruptly cut short a weeklong trip to Africa and returned to Washington at 4 a.m. Tuesday. State Department officials said Tillerson did not speak to the president and only learned of his firing from Trump’s Twitter post.


In a startling series of events that only highlighted the clash with the White House, the State Department made clear that Tillerson had not quit, saying he “had every intention of remaining” and was “unaware of the reason” for his dismissal. But the State Department official who issued the rebuttal, one of Tillerson’s top aides, then was fired by the White House for doing so.


The nation’s top diplomat was blindsided last week when Trump abruptly decided to accept an invitation for a summit with North Korean leader Kim Jong Un, the most ambitious diplomatic initiative of the Trump administration and one that normally would involve immense State Department input.


Speaking to reporters before he boarded Air Force One for his first visit to California as president, Trump said he and Tillerson “disagreed on things.”


“We’ve been talking about this for a long time,” Trump said, citing the Iran nuclear deal as a point of disagreement. Tillerson had urged Trump to stay in the landmark nuclear disarmament deal, but the president has vowed to withdraw by mid-May if it is not renegotiated.


“So we were not thinking the same,” Trump said. “With Mike Pompeo, we have a similar thought process.”


The president said he wished Tillerson well. “I’ll be speaking to Rex over a long period of time,” he added. “I actually got on well with Rex, but it was a different mindset.”


Trump repeatedly praised Pompeo, saying “we’ve had a very good chemistry right from the beginning.”


Gina Haspel, the CIA’s deputy director, is slated to replace Pompeo as head of the nation’s chief spy service. If confirmed, she will be the first woman to lead the agency as it faces new threats from Russia, China and other rivals and adversaries.


The Foreign Relations Committee expects to hold confirmation hearings on Pompeo’s nomination next month and he is likely to win strong bipartisan support. In January 2017, the full Senate confirmed him as CIA director by a vote of 66 to 32.


Tillerson, a voice of moderation in a chaotic administration, clashed repeatedly with Trump during his 14 months at State and reportedly referred to Trump as a “moron” during a private meeting last summer. Tillerson never confirmed or denied having made the remark, but it clearly reached Trump’s ears and incensed him.


That may explain Trump’s brusque dismissal. The White House chief of staff, John Kelly, phoned Tillerson at night, Africa time, over the weekend to tell him to expect a presidential tweet involving him. Tillerson did not interpret that as meaning he would be fired, an official close to him said.


He was back in Washington barely four hours Tuesday when Trump’s tweet landed.


Hours later, the White House also fired Steven Goldstein, whom Tillerson picked three months ago to serve as undersecretary of state for public affairs and diplomacy. Goldstein had given journalists the initial account of Tillerson’s reaction to the firing, one the White House disputed.


Tillerson is only the third U.S. secretary of state to be fired. The most recent was Alexander Haig, who was forced out in 1982 after his brash leadership caused problems with President Ronald Reagan.


Tillerson’s style was the opposite of brash. But he clashed with Trump over several key policy issues.


In addition to resisting Trump’s effort to scrap the 2015 deal with Iran to curb its nuclear ambitions, he opposed Trump’s decision to move the U.S. Embassy in Israel to the divided holy city of Jerusalem. The plan has seemingly destroyed chances of a negotiated resolution of the Israel-Palestinian conflict for the short term.


And despite a record of high-stakes energy deals with Russian authorities in his former job as chief executive of Exxon Mobil Corp., Tillerson has voiced more public mistrust of Moscow than Trump has.


On Monday, Tillerson again departed from the White House position — denouncing Russia for a poison attack in Britain that targeted a former Russian spy, who has criticized President Vladimir Putin, and his daughter. More than 20 people, including first responders, were injured by the chemical agent.


The attack “clearly came from Russia” and will “trigger a response,” Tillerson said before he returned from Africa. Earlier in the day, the White House had conspicuously declined to join British officials in blaming Russia for the attack.


But even as he differed with Trump, Tillerson had few allies on Capitol Hill or among the diplomats and civil servants in the sprawling department he headed. Many in the foreign service saw him as aloof and distant as he pursued a plan to cut budgets, trim staff and reorganize the department’s bureaucracy.


Although Tillerson was repeatedly said to be considering stepping down last year, the State Department made clear early Tuesday that Tillerson didn’t quit. It also suggested that Trump had fired him without cause.


“The Secretary had every intention of remaining because of the tangible progress made on critical national security issues,” it said. “He established and enjoyed relationships with his counterparts. He will miss his colleagues at the Department of State and enjoyed working together with the Department of Defense in an uncommonly robust relationship.”


It added, “The Secretary did not speak to the President this morning 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 and not to be regretted. We wish Secretary-Designate Pompeo well.”


Rep. Eliot Engel of New York, the ranking Democrat on the House Foreign Affairs committee, said Tillerson leaves behind a “hobbled” State Department.


“The timing of this move also couldn’t be worse,” Engel said. “Less than a week after announcing a summit with Kim Jong Un — the sort of engagement that will require a diplomatic full-court press — the president has let the world know that he’s throwing an already hollowed-out State Department into further disarray with a transition at the top. However much I may have disagreed with Secretary Tillerson, to push him out at this moment sends a terrible message to friends and adversaries all over the world.”


Pompeo, a retired Army officer and former congressman, has political skills that Tillerson lacks, said Michael Allen, who worked in the George W. Bush White House and advised the Trump transition.


“He can do media, he does the Hill, he does everything Tillerson didn’t do,” Allen said. “Most of all, he has Trump’s confidence.”


Trump’s allies on Capitol Hill generally applauded the move, suggesting that Pompeo brought a useful skill set to the nation’s diplomatic challenges.


“As director of the CIA, Mike has made contacts throughout the world and has come up with aggressive policies to defend our homeland,” said Sen. Lindsey Graham, R-S.C. “No one understands the threat posed by North Korea and Iran better than he does.”


Pompeo often briefs Trump in person in the Oval Office on critical intelligence issues, and over the last several weeks has played a pivotal role in brokering messages from South Korean officials about a possible meeting with the North Korean leader.


Tillerson was cut out of the loop in Africa when the White House announced that Trump had agreed to meet with Kim. Indeed, hours earlier, Tillerson had cautioned reporters that the U.S. and North Korea were still a long way from any negotiations.


His prediction may prove true since North Korea has not publicly responded to Trump’s acceptance of Kim’s invitation to meet, and officials have yet to set a date, location or agenda for a summit.


For much of his tenure, Tillerson traveled the world in a permanent mode of damage control, trying to placate allies in Europe and elsewhere who felt alienated or confused by Trump’s erratic policy pronouncements and threats. His trip to Africa was partly to mollify governments offended by Trump’s reported dismissal of immigrants from “shithole countries.”


Time after time, Tillerson had to explain to foreign allies what Trump has meant when he seemed to be insulting their countries. “The president’s tweets don’t define the policy,” Tillerson said last month during a trip to Latin America, where Trump’s policies have roiled relations.


The Texas oilman was a man of few words and low-key demeanor, a sharp contrast to Trump’s bombastic and flamboyant manner.


“The president and I are pretty different individuals in terms of our management style, in terms of our communication style,” Tillerson told reporters traveling with him in Latin America.


“It doesn’t mean one is right, one is wrong; one is better, one is worse,” he added. “But we’re very different, and the way I process information and come to decisions is different from the way he does.”