The original draft, in fact, was relatively moderate, American and Afghan officials said. But at the last minute more hard-line elements of Mr. Karzai’s staff weighed in, and the joint statement finally issued by the Ulema Council and the palace used language like “Satanic act” and “unforgivable, wild and inhuman” about the book burnings, and “justifiable emotion” in regard to the violent reaction, which claimed the lives of at least 29 Afghans and 6 Americans.

Western diplomats have often viewed Mr. Karzai’s outbursts as playing to the galleries, meant for consumption by his own people only, not as serious statements of policy. But the galleries also include the public in the United States and its NATO allies, where majorities in nearly every country oppose remaining in Afghanistan, and every new contretemps risks further eroding an already tenuous support.

“I think this is very serious because Mr. Karzai has always had a very ambivalent attitude toward the West and toward the war — he has never really believed violence is the answer,” said Sir Sherard Cowper-Coles, the British ambassador to Afghanistan from 2007 through 2009. “He is also very conscious and very resentful that his political survival and even perhaps his personal safety depend on the Americans.”

The current American ambassador, the veteran diplomat Ryan C. Crocker, was brought out of semiretirement by President Obama last July at least in part because he had known Mr. Karzai since the beginning: Mr. Crocker was the first envoy to Afghanistan after the invasion that defeated the Taliban, when Mr. Karzai was appointed interim leader here.

Like many of his predecessors, Mr. Crocker began his latest tour on an optimistic note. “President Karzai has the toughest job in the world, and he has been doing it for the last 10 years,” Mr. Crocker said early on, and has repeated often since. “You have to give him credit.”

While the two men still have a working relationship and meet often, according to aides to both, there are many signs that the warmth has gone out of that relationship once again.