President Biden’s decision last week to withdraw from Afghanistan seems, in hindsight, both surprising and foreordained.

It’s surprising because Biden is taking a big risk that few presidents would run — which is why his two predecessors kept troops there despite their desire to leave. Our top generals warn, The Post reports, that withdrawal could result in “the fall of Kabul to the Taliban, waves of Afghan refugees rushing to neighboring countries and Europe, and the reemergence of al-Qaeda as a potent terrorist threat.”

Whatever catastrophes may come are now on Biden’s head. He has taken ownership of the pullout and its consequences. The question is why. His decision appears foreordained because it grows out of his long disenchantment with our Afghanistan commitment.

Then-Sen. Biden started off as a strong supporter of a war launched after the Sept. 11, 2001, attacks. Like many Democrats, he castigated President George W. Bush in 2007 for surging forces in Iraq (another war he initially supported) rather than Afghanistan. The turning point in Biden’s views, as he said in his withdrawal announcement, was a 2008 trip he took to Afghanistan with two other senators. What he saw on that trip, Biden said, convinced him “that more and endless American military force could not create or sustain a durable Afghan government.” This was the trip when he had a famous confrontation with then-President Hamid Karzai, who disingenuously denied that corruption was a problem. Biden got so frustrated that he flung down his napkin and stalked out, saying, “This dinner is over.”

But even after returning home in 2008, Biden hardly argued for abandoning Afghanistan. “If Afghanistan fails and Pakistan falls prey to fundamentalism, both countries will pay a heavy price, and America — America will suffer a terrible, terrible strategic setback,” Biden told the Council on Foreign Relations. During President Barack Obama’s Afghanistan policy review in 2009, Biden did not urge a pullout. He argued, as Obama wrote in his recent memoir, for a “less troop-intensive, more CT [counterterrorism] alternative” to Gen. Stanley A. McChrystal’s proposed troop buildup.

At the time I agreed with McChrystal, but in hindsight Biden was right: The United States did not have the staying power to make counterinsurgency work in Afghanistan. It made more sense to maintain a lower-level presence focused on hunting down terrorists and assisting the Afghan security forces. It still does. In fact, I wish President Biden had followed Vice President Biden’s advice on Afghanistan.

Although Osama bin Laden is long dead, al-Qaeda remains alive, and now the Islamic State is also active in Afghanistan. Yet the withdrawal of U.S. troops will necessitate the unraveling of U.S. intelligence networks built up over two decades — and also probably the abandonment of CIA-run “strike forces” of Afghan fighters. “When the time comes for the U.S. military to withdraw,” CIA Director William J. Burns warned Congress last week, “the U.S. government’s ability to collect and act on threats will diminish. That’s simply a fact.”

The humanitarian cost of Biden’s decision is even greater than the strategic risk. What will happen to all of the people in Afghanistan — from soldiers to civil society activists — who believed in U.S. promises of freedom and risked their lives to secure it? How many will be persecuted and even executed by the Taliban?

According to George Packer’s book “Our Man: Richard Holbrooke and the End of the American Century,” Holbrooke, who was Obama’s Afghanistan-Pakistan envoy, raised the costs of abandoning “the people who had trusted us” with then-Vice President Biden in 2010. Biden’s response was shockingly callous: “F--- that, we don’t have to worry about that. We did it in Vietnam, Nixon and Kissinger got away with it.”

Does Biden still feel that way? I hope not. Yes, President Richard M. Nixon and Secretary of State Henry Kissinger “got away with it” — but at heavy cost to our South Vietnamese allies, as well as to U.S. standing in the world. It is incongruous for Biden to focus on reviving U.S. alliances while abandoning our allies in Afghanistan.

U.S. foreign policy should not be dictated by the least that we can get away with — but by the most that we can reasonably do. Keeping 3,500 troops in Afghanistan (0.25 percent of our active-duty military) was hardly an unmanageable commitment. Now Biden must ensure that the Afghan government continues to receive the funding it needs to survive while making provision for our local allies if it doesn’t.

As the eminent philosopher Michael Walzer argues, “When we leave, we must bring with us to the U.S. all the men and women, and their families, who are vulnerable to persecution, imprisonment, or death because of our invasion — directly, because they collaborated with us, but also indirectly, because they agitated for democracy, organized unions, or established schools for girls under our cover…. This is an absolute moral obligation.”

Biden speaks often and rightly of what we owe to U.S. soldiers — but he should never forget that we also owe something to those who counted on our troops for their very survival. That, in fact, is something I often hear in my conversations with veterans who worry about the fate of their erstwhile partners.

Read more: