WASHINGTON — The United States’ ambassador to Panama resigned. The top envoy to Pakistan was scolded by the government in Islamabad. And American diplomats across Africa have been made to explain President Trump’s vulgar description of their nations.

These are disorienting — and some say depressing — times for the country’s diplomatic corps, which was already wilting after a year of Secretary of State Rex W. Tillerson’s leadership style and a lackluster department reorganization. Then Mr. Trump derided “shithole” African countries during an immigration debate last week and questioned whether Haitians should be allowed to move to the United States.

The blowback was fierce.

On Wednesday, more than 80 former ambassadors to African nations over the last several decades sent a letter of protest to Mr. Trump. They said his description undermined American interests across the continent that has the world’s fastest growing population and five of the 10 fastest growing economies.