WASHINGTON — Four days before the U.S. urged all Americans traveling abroad to return immediately, American diplomats got an email informing them that anyone serving in a country deemed a Level 3 or higher health risk by the CDC could ask to cut short their tours and come home, no penalty.

Then the Centers for Disease Control and Prevention expanded its Level 3 travel health warning for the coronavirus to cover the entire world.

In the rough-and-tumble world of foreign service, diplomats and aid workers serving overseas plan and train for evacuations triggered from time to time by earthquakes, pestilence or war.

But the global coronavirus shutdown has created an unparalleled challenge for the State Department and U.S. Agency for International Development that they never anticipated: Evacuating American workers from nearly every corner of the globe, all at the same time.

International commercial air travel — the preferred method for evacuating diplomats in a crisis — has slowed to a total halt in some places. Charter flights that can be arranged can't reach every corner of the world. And there are still tens of thousands of U.S. citizens stuck abroad who need help getting home from U.S. embassies and consulates before diplomats can start returning in large numbers.

"There's really no playbook for this particular crisis," said David Wade, who was chief of staff to then-Secretary of State John Kerry.

He said during the Ebola crisis, it was an obvious choice to evacuate diplomats from Sierra Leone because the health system there was ill-equipped to treat any Americans who got Ebola.

"Now you have a totally unique situation where, do you bring a diplomat home from Sweden if they're headed back to Washington, D.C., which may actually have more of this pandemic?" Wade said.

A senior Trump administration official told NBC News that there are no plans for a total evacuation of all U.S. embassies and consulates, noting that it would be logistically impossible to do so all at once.

Decisions on who to evacuate are being made on a country-by-country basis, the official said, citing that the ongoing airlift of U.S. citizens has been a major complicating factor.

But already, at least 18 U.S. missions overseas have been put on some form of partial evacuation, including posts in Italy and in China, where nonessential personnel have been allowed to leave and the Wuhan consulate was shuttered.

In some places, like Indonesia and Turkmenistan, young family members of U.S. government workers have been ordered home. Anyone whose health puts them at a higher risk if they contract COVID-19 was also allowed to return home.

More than 25,000 Americans have already come home with government help from 50 countries since the pandemic started. Another 100 flights are expected to leave for the U.S. in the next week, carrying at least 9,000 Americans.

In the meantime, the number of diplomats who have contracted COVID-19 abroad is growing. Already, 75 U.S. diplomats overseas have tested positive, including the U.S. ambassador to Burkina Faso, with another nearly 100 awaiting results. Another 1,700 overseas staffers are in self-quarantine.

And on Friday, the State Department again urgently warned Americans overseas to find a way home now — however they can.

"We do not know how long commercial flights will remain available," said Ian Brownlee, a top consular official at the State Department. "Nor do we know how long the U.S. government will be able to facilitate additional flights where commercial options no longer exist."

In Peru, thousands of U.S. citizens remain stranded under strict local quarantine orders despite the State Department's best efforts to get them out. In Morocco, Americans were stranded when the country shut down its airspace, making it impossible even for the government to charter evacuation flights until U.S. diplomats intervened.

And in New York, where the U.S. government has hundreds of officials at its mission to the United Nations, almost all staff have been permitted to work remotely unless they're considered "mission-critical." They've been granted special permission to work from home outside the tristate area if they can effectively get into State Department computer networks.

Some 75,000 people work for the State Department, the majority of them overseas, although a sizable chunk are "local hires" and not Americans who would be evacuated to the U.S.

Complicating evacuation decisions these days is the fact that even though the U.S. health system performs better than those in many parts of the world, the United States is now the center of the crisis, with more known cases than anywhere else and less testing capacity per capita than many other parts of the world.

Former Ambassador Patrick Kennedy, who oversaw countless evacuations during a decade as under secretary of state for management, said every U.S. embassy and consulate has emergency plans that include sheltering in place, if necessary.

Each post has generators, large fuel and water tanks buried deep in the ground, and huge stores of MREs, or "meals ready to eat." But those contingencies are mainly geared toward short-term situations when violence erupts abruptly and diplomats or citizens shelter in the embassy, sleeping on couches or spare mattresses, until help can be sent from abroad.

"This is unprecedented, but it's a question of volume. The planning is the same," Kennedy said. "How many people do you have in Place A, how many in Place B? How many commercial flights are still available? How many planes?"

The State Department has only a few small planes and helicopters, used in war zones, and can't conduct airlift operations itself. The top choice for getting diplomats out in a hurry is commercial flights.

If those aren't available, Kennedy said, the State Department has transportation experts who can charter planes anywhere in the world. That includes working with airlines to get planes moving immediately with the understanding the U.S. will reimburse them later. If those options fail, the U.S. military is a last resort, because its cargo planes carry fewer passengers and are uncomfortable, with less access to bathrooms.

Even when embassies are largely evacuated, a core management team stays as long as possible to continue critical operations. That includes the ambassador, deputy chief of mission, the political and sometimes economic counselor, the regional security officer and U.S. Marines who protect the post. The ambassador is usually among the last to leave.

A few members of the consular team, who assist U.S. citizens who may still be stuck in the country, often stay behind as well. Former Ambassador Teresita Schaffer, who helped evacuate the U.S. posts in Pakistan during the 1979 Iranian Revolution, said those officials often have the best contacts in the local police corps, useful in a crisis.

She said in the case of the coronavirus, an embassy would likely hold on to its medical clinician — often a doctor or nurse — because they'll have the best contacts at hospitals and knowledge of the local medical system.

"You get very practical about the comparative advantages of who you want to keep," Schaffer said.