“I was not only surprised, I was shocked — to me it showed how Washington was detached from reality of Afghanistan, the reality of the U.S. military,” Amrullah Saleh, a former Afghan intelligence chief, said of Mr. Trump’s talk of firing General Nicholson. He called the general “a rare and exceptional personality — he stands out.”

General Nicholson is now not only the American face of the war, but also the face of American continuity for an Afghan government dealing with a new administration in Washington. A new ambassador to Kabul has yet to be confirmed.

He has described himself as the product of the United States’ post-Sept. 11 campaign in Afghanistan. In this country, more than anywhere else, personal relationships are crucial. Battles often turn as much on winning the trust and faith of local leaders as on driving out the Taliban.

“I have seen many American commanders here, but the combination of qualities that Nicholson brings — as a professional general, as a leader who understands and is comfortable with the culture here — is very rare,” said retired Gen. Sher Mohammad Karimi, the former chief of the Afghan Army, who has known General Nicholson for a decade.

“I have watched him from when he was a colonel, to now that he is a general,” General Karimi said. “Even then, like he does now, he would meet elders in Khost and in Nangarhar, for lunch, for tea, for discussions.”

Even before 9/11, General Nicholson was part of a breed of Army officers trying to bring about a sweeping transformation, shaping the force for more agile fighting.