President Trump’s firing of Secretary of State Rex W. Tillerson sent shock waves through the world on Tuesday.

His 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 — surprised foreign policy experts.

Some critics raised the prospects of what they called a more hawkish and rightward turn in United States foreign policy. Others, however, noted that Mr. Tillerson, an oil executive with no prior government experience, had been deeply unpopular within the State Department. They speculated that Mr. Pompeo, a former congressman from Kansas who is highly regarded by Mr. Trump, might be more effective at managing both the president and the diplomatic corps.