The swift fall of Kabul recalls the ignominious fall of Saigon in 1975. Beyond the local consequences – widespread reprisals, harsh repression of women and girls, and massive refugee flows – America’s strategic and moral failure in Afghanistan will reinforce questions about US reliability among friends and foes alike.

NEW YORK – Afghan President Ashraf Ghani has fled the country. His government has collapsed as Taliban fighters enter Kabul. Bringing back memories of the ignominious fall of Saigon in 1975, two decades of America’s military presence in Afghanistan has vanished in a matter of weeks. How did it come to this?

There are wars of necessity, including World War II and the 1990-91 Gulf War. These are wars in which military force is employed because it is deemed to be the best and often only way to protect vital national interests. There also are wars of choice, such as the Vietnam and 2003 Iraq wars, in which a country goes to war even though the interests at stake are less than vital and there are nonmilitary tools that can be employed.

Now, it seems, there are also withdrawals of choice, when a government removes troops that it could have left in a theater of operation. It does not withdraw troops because their mission has been accomplished, or their presence has become untenable, or they are no longer welcomed by the host government. None of these conditions applied to the situation the United States found itself in Afghanistan at the start of President Joe Biden’s administration. Withdrawal was a choice, and, as is often true of wars of choice, the results promise to be tragic.

American troops first went to Afghanistan 20 years ago to fight alongside Afghan tribes seeking to oust the Taliban government that harbored al-Qaeda, the terrorist group responsible for the September 11, 2001, attacks that killed nearly 3,000 people in the US. The Taliban were soon on the run, although many of its leaders escaped to Pakistan, where over time they reconstituted themselves and resumed the fight against the Afghan government.

Troop numbers increased over the years – at one point during Barack Obama’s presidency to over 110,000 – as US ambitions in Afghanistan expanded. The cost was enormous: an estimated $2 trillion and close to 2,500 American lives, over 1,100 lives of its coalition partners, as well as up to 70,000 Afghan military casualties and nearly 50,000 civilian deaths. The results, however, were modest: while an elected Afghan government (unique in the country’s history) controlled the big cities, its grip on power remained tenuous, and the Taliban regained control over many smaller towns and villages.

The US intervention in Afghanistan was a classic case of overreach, a limited war of necessity initiated in 2001 that morphed over the years into a costly war of choice. But by the time Biden assumed the presidency, overreach was a thing of the past. American troop levels were down to around 3,000; their role was largely limited to training, advising, and supporting the Afghan forces. There had not been an American combat fatality in Afghanistan since February 2020. The modest US presence was both an anchor for some 8,500 troops from allied countries and a military and psychological backstop for the Afghan government.

In the US, Afghanistan had largely faded as an issue. Americans did not vote in the 2020 presidential election with the country in mind and were not marching in the streets protesting US policy there. After 20 years, the US had reached a level of limited involvement commensurate with the stakes. Its presence would not lead to military victory or peace, but it would avert the collapse of a government that, however imperfect, was far preferable to the alternative that is now taking power. Sometimes what matters in foreign policy is not what you can accomplish but what you can avoid. Afghanistan was such a case.

But this was not US policy. Biden was working from a script inherited from the administration of Donald Trump, which in February 2020 signed an accord with the Taliban (cutting out the government of Afghanistan in the process) that set a May 2021 deadline for the withdrawal of US combat troops. The agreement did not oblige the Taliban to disarm or commit to a ceasefire, but only to agree not to host terrorist groups on Afghan territory. It was not a peace agreement but a pact that provided a fig leaf, and a thin one at that, for American withdrawal.

The Biden administration has honored this deeply flawed agreement in every way but one: the deadline for full US military withdrawal was extended by just over three months. Biden rejected any policy that would have tied US troop withdrawal to conditions on the ground or additional Taliban actions. Instead, fearing a scenario in which security conditions deteriorated and created pressure to take the politically unpopular step of redeploying troops, Biden simply removed all US forces.

As was widely predicted, momentum dramatically shifted to the Taliban and away from the dispirited government after the announced (and now actual) US military departure. With the Taliban taking control of all of Afghanistan, widespread reprisals, harsh repression of women and girls, and massive refugee flows are a near certainty. Preventing terrorist groups from returning to the country will prove far more difficult without an in-country presence.

Over time, there is the added danger that the Taliban will seek to extend their writ to much of Pakistan. If so, it would be hard to miss the irony, as it was Pakistan’s provision of a sanctuary to the Taliban for so many years that allowed it to wage war. Now, in a modern-day version of Frankenstein, it is possible that Afghanistan will become a sanctuary for taking the war to Pakistan – potentially a nightmare scenario, given Pakistan’s fragility, large population, nuclear arsenal, and history of war with India.

The hasty and poorly planned US withdrawal may not even provide sufficient time to evacuate now-vulnerable Afghans who worked with the US and Afghan governments. Beyond the local consequences, the grim aftermath of America’s strategic and moral failure will reinforce questions about US reliability among friends and foes far and wide.

Biden was recently asked if he harbored any regrets about his decision to withdraw all US troops from Afghanistan. He replied that he did not. He should.

Richard Haass, President of the Council on Foreign Relations, is the author, most recently, of The World: A Brief Introduction.