Strategic allies aren't always best friends. But once again, Afghan President Hamid Karzai has gone out of his way to insult the United States and dishonor the memories of Americans who made the ultimate sacrifice defending his government and citizenry.

The latest episode came Sunday. During the first foreign trip by recently confirmed Secretary of Defense Chuck Hagel, Taliban suicide bombers killed at least 18 with blasts outside the Afghan Defense Ministry and in Khost province.

Responding to the carnage, Karzai said, "In reality, the bombs that went off yesterday under the name of the Taliban were a service to the foreigners." Karzai was seemingly subscribing to the theory that spiraling violence would justify keeping U.S. troops in the country.

The charge was categorically rejected by Gen. Joseph Dunford, the top U.S. commander in Afghanistan.

"We have shed too much blood over the past 12 years, we have done too much to help the Afghan security forces grow over the past 12 years to think that violence or instability would be to our advantage."

And within hours of Karzai's absurd analysis, even more American blood was shed. This time it was yet another devastating "green-on-blue" insider attack. An Afghan police officer killed two American special operations troops. Three Afghan police officers, and the gunman, also were killed.

The timing, let alone his conspiracy theory about the Taliban, should shame Karzai into an apology. But that's unlikely, especially since he appears to be playing domestic politics at the expense of the foreign forces protecting him and his constituents.

The American presence is deeply unpopular in part of Afghanistan, and Karzai may be trying to burnish his image there by criticizing U.S. policies, including night raids by U.S. special operations forces. He also reportedly is upset that the United States had not yet yielded control of Bagram Prison, in part due to fears that Karzai would release prisoners who pose a danger to U.S. troops.

Karzai's outburst is part of a pattern that has undermined the U.S. mission. The counterinsurgency strategy at the heart of the "surge" depends on winning hearts and minds, but that's tough when it's widely alleged that Karzai has corruptly stuffed ballot boxes and his own pockets. And it's not the first time he's invoked the Taliban as he lashes out against the United States: He once threatened to join the Taliban himself.

All this comes as the United States continues to draw down forces in anticipation of ending the combat mission in 2014. By then, after 13 years of NATO sacrifices and investment, the end game should be a lopsided battle between professional Afghan forces and the ragtag Taliban. But Karzai has been unable or unwilling (or both) to rally his country to create a more effective, let alone powerful, national army. There are many factors contributing to this sad state of affairs, but much of the blame resides within the Afghan capital.

"A great deal is due to Karzai, and the Afghan government beyond Karzai, and its inability to participate in the building of a more modern and capable state," said Daniel Markey, senior fellow for India, Pakistan and South Asia at the Council on Foreign Relations.

Indeed, Karzai's own incapable state will make it even harder to consolidate gains made by coalition soldiers and negotiate a postcombat status of forces agreement. And Karzai's comments may tempt U.S. officials to accelerate the drawdown.

But unlike Karzai, U.S. leaders must make rational, unemotional calculations, keeping in mind that nonstrategic thinking only further emboldens the Taliban, dishonors the sacrifices of our troops and endangers the Afghan people.

------------

An editorial of the Star Tribune (Minneapolis). Follow the editorial board on Twitter and on Facebook.