If you listen to President Biden and his advisers, they had no alternative but to set in motion the collapse of Afghanistan’s government, leaving tens of thousands of Afghans who worked with, and trusted, the United States in the lurch.

National security adviser Jake Sullivan on Tuesday argued “that when a civil war comes to an end … there are going to be scenes of chaos” and “that is not something that can be fundamentally avoided.” He also argued that it “is simply wrong” to imagine “that with 2,500 forces … we could have sustained a stable, peaceful Afghanistan.” That “would have taken a significant American troop presence, multiple times greater than what President Biden was handed. … And we would have taken casualties.”

Is the Biden administration right that the fall of Afghanistan was inevitable, unless the United States was prepared to pay a heavy price in blood to avert it? That is a historical hypothetical with no certain answer. But the bulk of the evidence suggests that the administration is wrong.

Biden, admittedly, was left in a tough spot by his predecessor. President Donald Trump reduced U.S. forces in Afghanistan from roughly 13,000 to 2,500 and promised to pull all of them out by May 1 of this year in return for next to nothing from the Taliban. That agreement, reached in February 2020, demoralized Afghan forces and emboldened the Taliban.

Sullivan probably has a point that 2,500 troops was too small a presence to assure the survival of the Afghan government. The congressionally chartered, bipartisan Afghanistan Study Group concluded in February “that around 4,500 troops are required to secure U.S. interests under current conditions and at an acceptable level of risk.” But the study group did not call for sending U.S. troops into ground combat. Its report argued that a slightly larger U.S. force focused on “training, advising, and assisting Afghan defense forces” would be enough.

There is no reason to believe that this slightly increased U.S. presence would have resulted in many U.S. casualties. U.S. troops stopped suffering heavy losses after they transitioned in 2014 to a primarily advisory mission. Most troops were relatively safe on large bases the Taliban could not effectively attack. Yet the support they provided to the Afghan government — both material and psychological — remained crucial.

“The probability of maintaining some sort of stability in Afghanistan after a prompt withdrawal of troops and a substantial reduction in aid is minimal,” the Afghanistan Study Group warned. “Almost every interlocutor the Study Group consulted used the word ‘catastrophic’ or a synonym thereof to describe the effects of this option.” Instead of pulling U.S. forces out on May 1, the study group recommended shifting to a conditions-based pullout — i.e., U.S. troops would leave only if peace talks made progress.

Biden ignored that good advice and decided to withdraw even though peace talks were going nowhere. Even then, the callous nature of the pullout was gratuitous. The United States could have evacuated tens of thousands of interpreters and other local allies much more readily while the Afghan government still controlled the cities and the United States still maintained major air bases around the country. Instead, Biden pulled out without having done anything to get our allies to safety.

Now, that task is much harder with U.S. troops limited to one section of the Kabul airport surrounded by Taliban checkpoints. The result has been scenes of chaos, with thousands of desperate Afghans swarming the runways. Some even tried to stow away in a U.S. C-17 aircraft only to fall to their deaths. That horrifying image will define America’s defeat.

It will be up to future historians to figure out why this happened — but, like most historical events, it was hardly predetermined. My own theory is that Biden has been hellbent on leaving Afghanistan ever since, as he mentioned on Monday, he lost the internal debate in the Obama administration over the Afghanistan surge in 2009. The Trump withdrawal deal, awful as it was, did not compel the pullout but merely gave Biden a convenient excuse to do what he wanted to do anyway.

The callousness that Biden, normally the most empathetic of politicians, has displayed toward the people of Afghanistan is long-standing. As I noted earlier this year, George Packer’s book “Our Man: Richard Holbrooke and the End of the American Century” recounts a conversation that Holbrooke, then Obama’s Afghanistan-Pakistan envoy, had with then-Vice President Biden in 2010. Holbrooke raised the costs of abandoning “the people who had trusted us.” Biden’s response: “F--- that, we don’t have to worry about that. We did it in Vietnam, Nixon and Kissinger got away with it.”

The conduct of U.S. foreign policy should not be based on what we can get away with — but on what we can achieve at reasonable cost. No, we weren’t able to magically transform Afghanistan into Switzerland or defeat the Taliban, but we were able, at low cost, to keep most of the country out of the militants’ grasp. The collapse occurred only after an unnecessary and unwise U.S. withdrawal that Biden and his aides are now unsuccessfully struggling to justify.