President Trump’s firing of Rex W. Tillerson as secretary of state sent shock waves through the world on Tuesday, leaving many governments initially speechless and raising the prospects of what critics called a more hawkish and rightward turn in United States foreign policy.

Mr. Trump’s unhappiness with Mr. Tillerson, who once called him a “moron,” was well known, and the possibility of his replacement by the C.I.A. director, Mike Pompeo, was floated last autumn. Even so, the abruptness of the dismissal — hours after Mr. Tillerson returned from a tour of Africa and on the brink of awaited talks between President Trump and the leader of North Korea — stunned foreign policy experts.

That Mr. Tillerson appeared, like everyone else, to have learned the news from Twitter only contributed to the picture of an administration that has abandoned conventional decorum in favor a reality television show-style of freewheeling decision-making. More gravely, observers worried that low morale at the State Department, which has seen an exodus of diplomats, would plunge further.

“Tillerson loathed by State Dept diplomats, but balanced & sensible in most areas of foreign policy,” Ian Bremmer, president of the Eurasia Group, a political risk consultancy, said in a Twitter message. “Pompeo dramatically more hawkish on N Korea and Iran. Challenging day for the planet.”

Human rights advocates, while never enamored with Mr. Tillerson, also expressed alarm at Mr. Pompeo’s elevation. They were even more alarmed that Mr. Pompeo’s deputy at the C.I.A., Gina Haspel, had been named to replace him, given her role in coercive interrogations of terrorism suspects in the years after the Sept. 11 attacks.

The American Civil Liberties Union called Ms. Haspel the “central figure in one of the most illegal and shameful chapters in modern American history.”

Vincent Warren, the executive director of the Center for Constitutional Rights, said in a statement that “Gina Haspel should be prosecuted, not promoted.”

A conspicuous exception to the surprise was the reaction of the United States ambassador to the United Nations, Nikki R. Haley, whose antipathy for Mr. Tillerson was an open secret.

Without mentioning Mr. Tillerson by name, she posted an enthusiastic message on Twitter moments after Mr. Trump’s announcement:

There was no immediate official reaction in Asia, partly because of the timing of Mr. Trump’s announcement — late evening in China, Japan and the Korean Peninsula, where news of his intended meeting with the North Korean leader, Kim Jong-un, is still sinking in.

In Iran, the official Islamic Republic News Agency’s website posted an unflattering photo of Mr. Pompeo, who has made it clear he considers the Tehran government more of a threat than Mr. Tillerson did.

Some speculated that Mr. Tillerson’s criticism of Russia over allegations it is responsible for the poisonings of former Kremlin spies living in Britain may have been more than coincidental to his dismissal. Mr. Trump has avoided such criticism of Russia.

“Today Tillerson is fired as Secretary of State. While friction with Trump was months-old, the abrupt timing here is suspect,” Beau Willimon, the creator of the television series “House of Cards,” said on Twitter.

In Europe, where disdain for the Trump administration is widespread, Enrico Letta, a former Italian prime minister, said of Mr. Tillerson’s dismissal on Twitter: “This will make many laugh even more, as usually happens when one speaks of Trump. For me, he scares me more and more.”

Michael Roth, Germany’s deputy foreign minister, tweeted: “The dismissal of Rex Tillerson does nothing better.”

In Russia, a government spokeswoman made a crack after the firing.

“Have they started blaming Russia yet for the Washington staff changes?” the Foreign Ministry spokeswoman, Maria Zakharova, said in a text message sent to Agence France-Presse.

Many observers on Twitter speculated about the timing of the firing — only hours after Mr. Tillerson delivered the administration’s strongest and clearest statement to date on the March 4 poisoning of a Russian former spy in Salisbury, England, with a nerve agent.

“I’ve become extremely concerned about Russia,” Mr. Tillerson told reporters while flying from Nigeria to Cape Verde, before returning to the United States. “We spent most of last year investing a lot into attempts to work together, to solve problems, to address differences. And quite frankly, after a year, we didn’t get very far. Instead what we’ve seen is a pivot on their part to be more aggressive.”

He added: “And this is very, very concerning to me and others, that there seems to be a certain unleashing of activity that we don’t fully understand what the objective behind that is. And if in fact this attack in the U.K. is the work of the Russian government, this is a pretty serious action.”

However, White House officials said the decision to fire Mr. Tillerson had been made earlier: The White House chief of staff, John Kelly, tried to call Mr. Tillerson on Friday and Saturday, apparently to warn him that if he did not step down, he would be dismissed.

Bill Kristol, a conservative commentator, questioned the style of the dismissal. “Has Trump ever had the nerve to fire someone face to face?” he asked on Twitter, noting that the former F.B.I. director, James B. Comey, learned that he was out of a job in March, while on a trip to San Francisco.

Jack Posobiec, a right-wing provocateur with a track record for disseminating false information, was one of a few prominent Trump supporters who embraced the decision.

“Tillerson didn’t want to name Jerusalem Israel’s capital, wanted to stay in Paris climate agreement, and often undermined the President publicly and insulted him privately” Mr. Posobiec said. “No surprise why this guy was fired.”