Bombings at presidential inauguration ceremonies in Afghanistan are only the latest evidence that America’s 18-year-long military mission there hasn’t built a stable government. The wise course, difficult though it may be, is to acknowledge that nation building is a very long-term project, and cannot be accelerated — and might even be impeded — by outside interference.

But too many in the U.S. foreign policy establishment want to use the continuing violence in Afghanistan as an excuse for making the longest war in U.S. history go on even longer. President Donald Trump’s peace deal with the Taliban, which includes a full U.S. withdrawal in 14 months, faced immediate backlash, with critics calling it “a gamble”, “disgraceful”, and “a very bad deal.” Former national security advisor Susan E. Rice declared that a U.S. withdrawal amounted to “abandoning Afghanistan to the Taliban wolves.”

Proponents of sustaining military operations in Afghanistan generally exaggerate the dangers of leaving, while downplaying the problems associated with staying.

In a recent paper, the Cato Institute’s John Glaser and John Mueller responded to the leading justifications for continued U.S. presence. They explain why the removal of troops is unlikely to result in an increase in terrorist activity directed at the United States — the original reason for going to war. The relationship between al Qaeda and the Taliban was often contentious — and made worse after 9/11.

There are also reasons to doubt that a single, physical location is essential to al Qaeda’s — or other terrorist organizations’ — survival. In attacks from Madrid (2004), to London (2005), to Paris (2015), and most recently Brussels and Istanbul (2016), “none of the attackers in those incidents operated from a safe haven, nor were their plans coordinated by a group within a safe haven.”

In retrospect, the entire enterprise may have been doomed almost from the beginning. The Taliban knew to bide their time while U.S. taxpayers spent trillions on the war effort. Eventually, they suspected, Americans would tire of it. They were right. A poll taken in 2018 found that a clear majority, including 69 percent of military veterans, were supportive of a decision to withdraw.

As Carter Malkasian explains in Foreign Affairs, one idea runs deep in Afghan culture: resistance to a foreign occupier. “It inspired Afghans to defend their honor, their religion, and their homeland.”

We didn’t need Malkasian to tell us that. Afghanistan’s reputation for exhausting global superpowers dates back to Alexander the Great. The British fought three wars to gain control of territory in the late 19th and early 20th centuries, but local guerilla fighters pushed them out each time. The Soviet Union’s intervention in 1979, which eventually included tens of thousands of troops, failed to save the communist government in Kabul, and hastened the demise of another government — in Moscow.

And yet, U.S. policymakers have attempted, as Mark Cancian of the Center for Strategic and International Studies noted last year, “to take a society that is politically decentralized, religiously devout, socially conservative, clan and tribe based, and patriarchal, and to turn it into the Western vision of a twenty-first-century society.” It is hardly surprising that this effort failed. It is far more surprising that anyone ever thought it could succeed.

State building is almost always purchased with blood. The dangerous idea that the United States can short-circuit this process has crippled many developing countries’ abilities to fashion a durable political order. Indeed, the U.S. military presence has undermined the credibility of the Afghan government, with the Taliban routinely dismissing elected officials in Kabul as mere foreign puppets.

Afghanistan’s President Ashraf Ghani has therefore understandably urged Afghans to prepare for the next phase of their country’s political evolution. Following the attacks on his and his rival Abdullah Abdullah’s inaugurations, Ghani said, “Don’t be afraid of these one or two explosions.” He went on to say that he was ready for whatever violence cropped up following an American military withdrawal.

Whether the United States will adhere to its planned withdrawal is an open question. The fragile deal has faced many setbacks. Two men claiming the Afghan presidency complicates an already tense and unstable political situation and calls into question whether the Afghan government’s peace talks with the Taliban can possibly succeed.

Still, it would be a costly mistake for the Trump administration to reverse course and return to an open-ended mission in pursuit of unobtainable objectives.

Staying the course established by the just-concluded deal, and withdrawing U.S. forces during the next 14 months, will not be easy. Outsiders, and even some Afghans, will claim that the United States has a duty to stop the violence there and alleviate the inevitable human suffering. But President Trump — or his successor — must remember that an open-ended foreign occupation of a country notoriously hostile to interlopers is no substitute for a durable, if imperfect, political settlement.