The American role in Afghanistan is drawing to a close in a manner paralleling the pattern of three other inconclusive wars since the Allied victory in World War II: a wide consensus in entering them, and growing disillusionment as the war drags on, shading into an intense national search for an exit strategy with the emphasis on exit rather than strategy.

We entered Afghanistan to punish the Taliban for harboring al-Qaeda, which, under Osama bin Laden’s leadership, had carried out the Sept. 11 attacks. After a rapid victory, U.S. forces remained to assist the construction of a post-Taliban state. But nation-building ran up against the irony that the Afghan nation comes into being primarily in opposition to occupying forces. When foreign forces are withdrawn, Afghan politics revert to a contest over territory and population by various essentially tribal groups.

In our national debate, the inconclusive effort was blamed on the diversion of resources to Iraq rather than on its inherent implausibility. The new Obama administration coupled withdrawal from Iraq with a surge of troops and material in Afghanistan — an effort I supported in substance if not in every detail. We have now reached its limit.

The stated goal of creating a government and domestic security structure to which responsibility for the defense of Afghanistan can be turned over is widely recognized as unreachable by 2014, the time most NATO nations have set as the outer limit of the common effort. Polls show that more than 70 percent of Americans believe that the United States should withdraw from Afghanistan.

The quest for an alternative has taken the form — it is widely reported — of negotiations under German sponsorship between representatives of Mullah Omar, the head of the Taliban, and American officials. Most observers will treat this as the beginning of an inexorable withdrawal. The death of bin Laden, while not operationally relevant to current fighting, is a symbolic dividing line. Still, the challenge remains of how to conclude our effort without laying the groundwork for a wider conflict.

For negotiation to turn into a viable exit strategy, four conditions must be met: a cease-fire; withdrawal of all or most American and allied forces; the creation of a coalition government or division of territories among the contending parties (or both); and an enforcement mechanism.

Enforcement is the most crucial element and the most difficult to sustain. After decades of civil war, the parties are unlikely to feel bound by provisions of any agreement. The Taliban especially will try to take over the coalition government or breach the cease-fire. In the absence of a plausible enforcement mechanism, a negotiation with the Taliban, whose forces remain while ours leave, will turn into a mechanism for collapse.

This is particularly the case if negotiations are accompanied by withdrawals amid a public debate over accelerating the process. The more rapid and substantial the immediate withdrawal, the more difficult the negotiating process will be. We must choose our priorities.

An enforcement mechanism can be a residual American force, some international guarantee or presence, or — best — a combination of both. Total withdrawal is likely to be final; there should be no illusion of reintervention.

Although the predominant role of the United States sometimes obscures it, the outcome in Afghanistan is, in essence, an international political problem. The perception that the strongest global power has been defeated would give an impetus to global and regional jihadism. Militant Islam would be encouraged to magnify similar tactics in Kashmir or in India proper, such as the 2008 attacks in Mumbai. The end of such a process is likely to be a proxy war along ethnic fault lines in Afghanistan and elsewhere, especially between nuclear-armed India and Pakistan.

Afghanistan’s other neighbors would be at comparable risk if a Taliban-dominated government or region reverted to the Taliban’s original practices. Every neighbor would be threatened: Russia in its partly Muslim south, China in Xinjiang, Shiite Iran by fundamentalist Sunni trends. In turn, Iran would be tempted by the vacuum to arm sectarian militias, a strategy it has honed in Lebanon and Iraq.

The complexities of an exit strategy are compounded because relations with Pakistan and Iran are severely strained. These countries do not have the option of withdrawing from the neighborhood. If their interests in Afghanistan are not related to ours to some extent, Afghanistan will exist under permanent threat. Without a sustainable agreement defining Afghanistan’s regional security role, each major neighbor will support rival factions across ancient ethnic and sectarian lines — and be obliged to respond to inevitable crises under the pressure of events. That is a prescription for wider conflict. Afghanistan could then play the role of the Balkans prior to World War I.

Such an outcome would threaten the security of Afghanistan’s neighbors more than America’s. A partly regional, partly global diplomatic effort is needed to accompany direct negotiation with the Taliban. So long as America bears the primary burden, Afghanistan’s neighbors avoid difficult decisions. To the extent that U.S. postwar withdrawal is made explicit and inexorable, they will be obliged to take another look. The formal deadline established by NATO, the implicit Obama administration deadline and the public mood make it impossible to persist in an open-ended civil war. An immediate withdrawal largely for symbolic reasons would risk falling between all shoals. A multilateral diplomacy that defines a common international security interest proscribing terrorist training centers and terrorist infrastructure in Afghanistan should be undertaken urgently. To encourage this process, a deadline should be established for reaching a residual force — say, in 18 months to two years, with the major reductions coming at the end of the process. Should a reliable international enforcement mechanism emerge, the U.S. residual force can be merged into it. A regional conference is the only way a bilateral negotiation with the Taliban can be enforced. If the process proves in­trac­table, Afghanistan’s neighbors will eventually have to face the consequences of their abdication alone.

After America’s withdrawals from Iraq and Afghanistan and the constraint to our strategic reach produced by the revolution in Egypt, a new definition of American leadership and America’s national interest is inescapable. A sustainable regional settlement in Afghanistan would be a worthy start.

Henry A. Kissinger was secretary of state from 1973 to 1977 and is the author, most recently, of “On China.”