If enough Pashtun soldiers are alienated by developments in Kabul, they will desert with their weapons to join either the Taliban or local warlords — and the army will collapse.

Given all these threats, it would make far more sense for the United States to seek a settlement with the Taliban while it still has cards to play. The Obama administration has opened direct talks with the Taliban, through a Taliban office being established in Qatar. Unfortunately, powerful sections of the Washington establishment wish to use these talks not to seek an agreement with the Taliban as a whole, but to try to split that organization. They are counting on divisions among the Taliban, even as they forget that the West’s side in the Afghan civil war is even more divided.

Moreover, one element of the Obama administration’s strategy would make agreement impossible. This is the insistence, deeply unpopular among many Afghans, that the United States retain bases, special forces and military advisers in Afghanistan until at least 2024.

Washington wants to keep forces on the ground that can both continue to hunt Al Qaeda and prop up an administration in Kabul. In practice, however, this plan risks landing the United States with the worst of all worlds. The continued presence of such forces will make agreement with the Taliban impossible, so the war will continue. And if the Kabul administration and army disintegrate, then U.S. advisers will be mired in the resulting disaster.

Instead, Washington should pursue a peace settlement along the following lines: the guarantee of a complete withdrawal of Western forces; the exclusion by the Taliban of all international terrorists from the areas they control; and a Taliban crackdown on heroin production in return for international development aid to those areas.

Central to such a settlement would be an Afghan national debate on a new constitution, abandoning the present highly centralized form of government in favor of decentralization and a nonexecutive presidency. That would allow the United States to escape from the trap of how to replace Karzai, and allow the Taliban and their allies to take effective control of the south and east of the country, while acknowledging the right of other groups to administer their own areas.