Despite ongoing peace negotiations between the United States and the Taliban, the bloody conflict in Afghanistan continues to take a heavy toll on the country’s people. The recent suicide bombing by the Khorasan branch of the Islamic State (IS-K) at a wedding in Kabul, which killed more than 60 and injured close to 200, is a stark reminder of Afghanistan’s poor security situation. It also shows that the Taliban are not the only armed opposition fueling the conflict. A U.S.-Taliban peace pact is therefore unlikely to bring any respite.

The U.S.-Taliban negotiations in Doha — in which the Afghan government is not a participant — are comparable to two previous peace processes: the Paris talks that resulted in the January 1973 peace treaty between the U.S. and North Vietnam; and the negotiations that led to the 1988 Geneva Accords, signed by the Afghan and Pakistani governments with the Soviet Union and the U.S. acting as guarantors.

These two agreements were designed to enable the U.S. and the Soviet Union to exit with “honor” from wars they could not win, by bringing about, respectively, the “Vietnamization” and “Afghanization” of those conflicts. Both agreements failed to achieve their objectives.

By 1975, Soviet-backed North Vietnamese forces had overrun South Vietnam, humiliating the U.S. And in 1992, the U.S.-supported Afghan Islamic resistance forces, the mujahideen, brought about the collapse of the Soviet-installed communist regime in Kabul.

Whereas the North Vietnamese soon succeeded in uniting their country and restoring peace, however, Afghanistan has fared much worse. The socially and politically divided mujahideen soon turned their guns on one another. And Pakistan took the opportunity to advance its regional interests by nurturing the extremist Taliban, who in 1996-98 conquered most of Afghanistan and subjected it to strict theocratic rule.

The Taliban in turn harbored al-Qaida, which carried out the Sept. 11, 2001, terrorist attacks on the U.S. That prompted America, backed by its NATO and non-NATO allies, to intervene in Afghanistan the following month with the aim of destroying al-Qaida and dislodging the Taliban regime. The U.S.-led forces quickly dispersed al-Qaida’s leadership and ended Taliban rule, but failed to defeat either group decisively. The Taliban and elements of al-Qaida staged a comeback within two years of the U.S. intervention, and have tied down American and allied forces in a low-grade but staggeringly costly insurgency ever since.

Now, after nearly two decades of fighting, U.S. President Donald Trump desperately wants to disentangle America from a seemingly unwinnable war — preferably through a political settlement with the Taliban. Trump’s Special Representative for Afghanistan Reconciliation, the Afghan-American Zalmay Khalilzad, has been engaged since September 2018 in shuttle diplomacy, in an eerie parallel with the unsuccessful efforts of then-U.S. Secretary of State Henry Kissinger to bring about peace in the Middle East following the 1973 Arab-Israeli War.

Khalilzad has just begun his ninth round of negotiations with Taliban representatives in Doha. Separately, he has had numerous meetings with the Afghan government and non-governmental leaders, as well as with regional and international actors — but not Iran, with which the U.S. is locked in a cycle of deepening hostility.

He has focused on four interrelated objectives: a timetable for the exit of all foreign troops currently in Afghanistan; a commitment from the Taliban to prevent hostile acts being launched against the U.S. from Afghan soil; direct negotiations between the Taliban and the Afghan government, which the Taliban regard as “illegitimate” and a “puppet”; and a ceasefire across Afghanistan.

But although Khalilzad may finally manage to reach agreement with the Taliban regarding the first two aims, there is no guarantee that America’s partner in the peace talks will help to realize the remaining two. The Afghan government’s weakness and internal divisions would give the Taliban the upper hand in any power-sharing arrangement, particularly after U.S. and allied forces have left. And it is very doubtful that the Taliban, whether in power or as a partner in power, would be able to control other armed opposition groups, most importantly IS-K, or enlist the support of a cross-section of Afghanistan’s diverse population.

The Taliban are ethnic Pashtuns, hailing specifically from the Ghilzai tribe to which Afghan President Ashraf Ghani and many around him belong. Neither the Ghilzais nor the rival Durrani tribe of former President Hamid Karzai are much trusted by non-Pashtun ethnic groups, who (though themselves divided) collectively form the largest share of Afghanistan’s population. To complicate matters further, all Afghan ethnic groups have extensive cross-border ties with the country’s neighbors.

Meanwhile, IS-K has loyalty to no one inside Afghanistan. The group became operational in 2015 and is said to have about 2,000 fighters (including some Taliban defectors), who are dedicated to creating disruption and chaos. They have been responsible for horrific attacks across Afghanistan, especially in Kabul and mostly on civilian targets.

Any withdrawal of U.S. and allied forces during Trump’s current term, whether phased or otherwise, must be based on conditions on the ground. Otherwise, the consequences will be disastrous. Because of the way the peace process and the situation in Afghanistan have evolved, a hasty foreign-troop withdrawal would lead to a fiasco similar to those generated by the earlier Soviet retreat from the country and by the U.S. withdrawal from Vietnam.

To avoid such a catastrophe, the U.S. and its allies need to remain in Afghanistan for at least another decade. But Trump is in a hurry and thinks that a strong CIA presence in the country will manage to do what Western forces have been unable to achieve. More likely than not, that will prove to be wishful thinking.

Amin Saikal, a professor of political science at the Australian National University, is the author of “Zone of Crisis: Afghanistan, Pakistan, Iran and Iraq” and co-author (with James Piscatori) of “Islam Beyond Borders: The Umma in World Politics.” © Project Syndicate, 2019