PRESIDENT OBAMA spoke up forcefully on Tuesday about the massacre of Afghan civilians, allegedly by a U.S. soldier. He said that the United States “takes this as seriously as if it was our own citizens and our own children who were murdered” and promised to “spare no effort in conducting a full investigation.” Those were the right words. Following through with his commitment to “make sure that anybody who was involved is held fully accountable with the full force of the law” could help to repair damage with Afghans who are understandably outraged by the killings.

Yet Mr. Obama’s follow-up comments, on his strategy in Afghanistan, were troubling. While saying that he was “confident that we can continue the work of meeting our objectives,” the president said his goal was to “responsibly wind down this war” and “bring our troops home.” He promised to “continue the work of devastating al-Qaeda’s leadership and denying them a safe haven,” but he made no mention of defeating the Taliban or of peace for the Afghans themselves.

There are many reasons why both Afghans and Americans are souring on their alliance, including a few over which this White House has no control. But Mr. Obama and his aides have done much to damage the relationship between the two countries and public morale on both sides. Tuesday’s comments were but one more example.

The president came to office pledging a revitalized campaign in Afghanistan. But he began by terminating President Bush’s practice of regular personal communications with President Hamid Karzai. Several of his envoys treated Mr. Karzai roughly and disparaged him in public. The U.S. official most able to work with the Afghan leadership, Gen. Stanley A. McChrystal, was abruptly pushed out of his post because of a hyped magazine article. Mr. Karzai is an erratic personality — but is it any wonder that he has grown increasingly resistant to the Obama administration?

The president reluctantly accepted the advice of his generals that he adopt a strategy of counterinsurgency against the Taliban and send additional troops to carry it out. But he arbitrarily cut the number of troops sought by commanders; set an equally arbitrary deadline for beginning their withdrawal; and rejected the military’s advice that the pullout be staged after this year’s summer fighting season. Now his aides are reportedly pushing for further troop withdrawals next year, once again against the Pentagon’s recommendation. Meanwhile, negotiations with the Taliban are being pursued over Mr. Karzai’s head, and sometimes in spite of his objections.

As they watch these moves, Afghans, the Taliban and neighbors such as Pakistan can reasonably conclude that the United States, rather than trying to win the war, is racing to implement an exit strategy in which the interests of Afghans and their government are slighted. Americans, meanwhile, rarely hear Mr. Obama explain the mission or the stakes. In this context, it’s not surprising that Afghans show little tolerance for U.S. failures — whether it is this week’s shooting or the accidental burning of Korans. And it’s little wonder that most Americans favor withdrawing troops as quickly as possible. If it’s evident that the president won’t defend the war, and is focused on “winding down” rather than winning, why should anyone else support it?