Currently, there are more than 500 American diplomats and other civilian government staffers working under the embassy’s authority in Afghanistan, as well as up to a few thousand contactors and foreign employees. (State Department officials would not disclose a more precise number of employees at the embassy in Kabul.)

But staffing cuts are coming: A recent State Department review recommended reducing the number of contractors at the embassy. Many of them were pulled back to Kabul with the closing of consulates in Herat and Mazar-i-Sharif, and at least two other diplomatic outposts around Afghanistan, as the United States military began to withdraw.

It was not clear how many positions were being cut, although the senior State Department official said a vast majority were security and other support contractors.

Staffing levels at the embassy in Kabul have vastly fluctuated over the years. In 2012, during what was known as the civilian surge, more than 1,330 American officials were working for the embassy, according to the office of the State Department’s inspector general. That was up from 340 Americans in 2008, the auditors reported.

The American Embassy in Kabul has for years relied on the U.S. military for everything from transportation to food services. And if history is an indicator, the embassy’s fate will largely depend on how troops are pulled back.

Ten years ago, the American Embassy in Baghdad was responsible for leading the American effort in Iraq as the war began to wind down. Under American protocol, an ambassador outranks a military commander in a foreign country. But the Pentagon had pumped billions of dollars into Iraq and secured a relative, if tenuous, stability by subduing Sunni Muslim insurgents and Shiite death squads that had each terrorized the country.

“There was quite a tradition of the military running this,” said Mr. Hill, the United States ambassador in Baghdad at the time. “It proved kind of difficult to move the center of gravity over to the embassy.”