President Trump has chosen a new secretary of state, untested in diplomacy but more attuned to the president’s views and way of conducting foreign policy, at a time when the United States is facing an array of delicate and potentially dangerous national security challenges.

Seeking what he called “a different mind-set, a different thinking,” Trump said Tuesday that he was replacing the reserved and cautious Rex Tillerson with CIA Director Mike Pompeo, a former House of Representatives firebrand with strong “America First” and hard-line Republican credentials.

“With Mike, Mike Pompeo, we have a very similar thought process. I think it’s going to go very well,” Trump said as he left the White House for a trip to California.

Both Tillerson’s departure and the choice of Pompeo had been rumored for months, amid Trump’s clear unhappiness over public disagreements with Tillerson on issues ranging from Russia to the Middle East and North Korea. Although he frequently derided the rumors as “fake news,” Trump said Tuesday that he had been considering replacing Tillerson for “a long time.”

Even as President Trump ousts Rex Tillerson as secretary of state, it seems the White House is moving forward with a planned meeting with Kim Jong Un. (Jason Aldag/The Washington Post)

But the reality of the move, and the suddenness with which it was done — with Tillerson returning early from a trip to Africa, only to learn via a Trump tweet early Tuesday that he had been fired — startled and confused allies around the globe and many throughout the government.

In an afternoon appearance before reporters at the State Department, Tillerson’s voice quavered as he vowed to ensure an “orderly and smooth transition” before his formal departure on March 31. He expressed no gratitude or good wishes to Trump, thanked his staff, and commended the strong commitment to diplomacy of Defense Secretary Jim Mattis, who has often served as his ally in battles with the White House.

The Post's Anne Gearan talked March 13 about the firing of outgoing Secretary of State Rex Tillerson and the man tapped to be his successor, Mike Pompeo. (Sarah Parnass/The Washington Post)

Tillerson spoke of the importance of “allies and partners” in promoting global security, and he thanked the American people for their “devotion to a free and open society, to acts of kindness towards one another, to honesty.”

Pompeo, whose once-active Twitter account has lain dormant since he was nominated as CIA chief 14 months ago, said in a statement that he was “deeply grateful” to Trump and that he looked “forward to representing him and the American people to the rest of the world to further America’s prosperity.”

Trump also named CIA Deputy Director Gina Haspel to succeed Pompeo as the agency’s director. She would become the first woman to run the spy agency and could come under scrutiny during the Senate confirmation process over her past role in running one of the CIA’s “black site” prisons, where detainees were subjected to interrogation methods widely denounced as torture.

Senate Foreign Relations Committee Chairman Bob Corker (R-Tenn.) said he expected to hold a confirmation hearing for Pompeo in April. The closely divided chamber has stalled on confirming dozens of Trump nominees.

Reaction to the fast-moving events varied widely. Thomas Countryman, one of a number of career diplomats dismissed by Tillerson early in the administration as he gutted staff and supported Trump’s massive budget cuts, called him “a poor advocate for the State Department.”

But Tillerson, he said, “served as a Cabinet-level check on some of President Trump’s worst impulses, such as wanting to ‘break’ the Iran nuclear agreement. . . . If the new secretary of state has a disdain for diplomacy mirroring Trump’s, it will be bad for the department and the country.”

Sen. Lindsey O. Graham (R-S.C.), by contrast, said he “cannot think of a better choice” than Pompeo.

“No one understands the threat posed by North Korea and Iran better than he does,” Graham said in a statement, and “no one has a stronger relationship with President Trump.”

Pompeo, assuming that the Senate confirms him in time, will face a confluence of foreign policy decisions and potential national security crises this spring that would challenge even the most experienced diplomats.

A meeting between Trump and North Korea’s Kim Jong Un, tentatively to be held before the end of May, will bring two volatile leaders face to face with the highest stakes imaginable.

In mid-May, Trump has said, he will decide whether to end U.S. participation in the Iran nuclear deal, a determination that could profoundly change the United States’ relationships with its closest European allies and throw down a gauntlet before Tehran.

Even before those events, Trump is due to host, beginning Monday, in rapid succession, the leaders of Saudi Arabia, the United Arab Emirates and Qatar for complicated talks on Iran, Syria and the Israeli-Palestinian peace process.

Depending on how those bilateral talks go, the administration is hoping to bring the Persian Gulf leaders together for a May summit in Washington to broker an end to a regional dispute among them that has hobbled U.S. policy across the Middle East.

Tillerson has been deeply involved in all of those issues while operating with a skeleton staff that is expected to dwindle even more with his departure. On these and other challenges — including Russia — he has often been publicly at odds with Trump’s impulsive approach to foreign policy, counseling more traditional diplomacy rather than dependence on gut instinct.

Pompeo is likely to be more amenable to Trump’s way of doing business. As a congressman from Kansas and a tea party leader, he sharply opposed the Iran nuclear deal, tweeting just before his CIA nomination his determination to “roll back” the agreement.

Tillerson openly acknowledged the strong disagreement between himself and the president over Iran in early August, telling reporters that “he and I have differences of views on things like JCPOA and how we should use it,” using an acronym for the deal, which is officially called the Joint Comprehensive Plan of Action.

As CIA director, Pompeo has followed Trump’s lead in falsely insisting that the intelligence community concluded that Russia’s interference had not influenced the result of the 2016 presidential election. He has congratulated Trump on his boldness in agreeing to meet with North Korea’s Kim, a leader who Pompeo last year suggested was a good candidate for U.S.-authored regime change.

Tillerson had led the charge for international backing for harsh sanctions against North Korea, but he urged step-by-step diplomacy and was clearly taken unaware and aback by Trump’s quick agreement to a summit with Kim.

While battling the White House, Tillerson also had to contend with Nikki Haley, the U.S. ambassador to the United Nations, who publicly endorsed a proposal not to certify Iran’s compliance with the deal based on the notion that all of Iran’s activities, not just nuclear, should be considered when deciding on certification. He also reportedly clashed with Trump’s national security adviser, H.R. McMaster, himself a rumored short-timer in the White House.

While Pompeo’s CIA job has immersed him in intelligence related to North Korea, Iran and beyond, the new secretary of state will have no time for a diplomatic learning curve. It remains unclear whether Mattis, who often joined Tillerson in pressing Trump to be more patient and thoughtful on a range of issues, will be willing or able to continue in that role.

In a statement last fall, Corker said that Tillerson, Mattis and White House Chief of Staff John F. Kelly “are those people that help separate our country from chaos.” Since then, Kelly has come under sharp criticism in Congress — and even in the White House — for his conduct in the job.

In addition to the pending North Korea talks, the administration is involved in high-stakes diplomacy with Turkey over its policy in Syria, as well as upcoming trade negotiations. Most immediately, Saudi Arabian Crown Prince Mohammed bin Salman, known as MBS, is due to arrive here Monday.

Tillerson, as chief executive of ExxonMobil, had long and deep relationships with Arab leaders in the Persian Gulf. But his calls for caution were sometimes challenged by presidential son-in-law and adviser Jared Kushner, who has formed his own ties, often outside the purview of the State Department, with MBS and with Sheikh Mohammed bin Zayed, the crown prince of Abu Dhabi, who is seen as the United Arab Emirates’ de facto ruler.

Kushner has been counting on the gulf leaders to support his still-unrevealed peace plan, a prospect that was already thrown into doubt when Trump announced — over Tillerson’s objections — U.S. recognition of Jerusalem as Israel’s capital and plans to move the U.S. Embassy there from Tel Aviv.

When the Saudis and Emiratis, along with Bahrain and Egypt, broke relations and instituted a boycott of neighboring Qatar last summer, Trump openly supported them, backing their charges that Qatar supported extremism. Tillerson and Mattis, who noted the close U.S. military relationship with Qatar, quickly issued evenhanded statements calling for dialogue.

Eventually, after months of openly criticizing Qatar, Trump was persuaded to change course, offering to broker a deal among the nations at a summit at Camp David, Md. Saudi Arabia and the United Arab Emirates refused, and Tillerson and Mattis have spent much of the ensuing months voicing support for Qatar and trying to pressure the others to come to a Trump-led negotiation.

Ashley Parker, Philip Rucker and Carol D. Leonning contributed to this report.