Al-Qaida was debilitated long ago and building an Afghan democracy is fool’s gold. No more U.S. troops should give their lives. Bring them all home.

President Donald Trump has recently received from his Afghanistan negotiator, Zalmay Khalilzad, a nearly completed agreement with the Taliban to end the U.S. war in there. The war will soon have lasted 18 years and is already the longest in American history. The president needs to be realistic and take the deal, thereby agreeing to withdraw all U.S. forces from that fractured nation.

In any important task, humans can get sidetracked and forget the original purpose of their efforts. The U.S. government did that in Afghanistan almost from the very start of its intervention. Its original goal was to avenge al-Qaida’s 9/11 attacks on New York and Washington—which allegedly originated from the group’s retaliation for prior U.S. interventions in the Middle East—and try to prevent future similar ones.

US should have quit when it was ahead

The Taliban government of Afghanistan had reluctantly hosted al-Qaida on its soil and allowed it to train there. The United States not only used air power to attack Afghanistan, beginning in late 2001, but in conjunction with “friendly” Afghan forces, it put U.S. forces on the ground to ensure that al-Qaida and the Taliban government were destroyed. Yet those “friendly” forces allowed al-Qaida leader Osama bin Laden to escape to neighboring Pakistan, and the Taliban sheltered there, too.

Still, al-Qaida was severely debilitated. The United States should have quit then, while it was ahead.

Oftentimes, however, the United States goes beyond achievable realpolitik goals into flights of ideological fancy. This happened in Afghanistan, as then-President George W. Bush decided to keep some U.S. forces in the country to try to refashion the destitute, xenophobic nation into a democracy — while at the same time diverting intelligence resources, drones and special forces to his higher priority project of milking the 9/11 attacks to justify unnecessarily invading the unrelated Islamic country of Iraq.

Of course, America seemed oblivious that such meddling in the Middle East was what triggered bin Laden’s war against the United States in the first place. Although following Bush’s timetable for withdrawing U.S. forces from Iraq, his successor, President Barack Obama, trebled the number of boots on the ground in Afghanistan to about 100,000 to try to win the war. However, he gradually had to scale back the democracy-building goals.

Taliban cease-fire likely a pipe dream

In Afghanistan, as well as Iraq, U.S. military occupation triggered potent insurgency. A resurgent Taliban made a U.S. victory in Afghanistan impossible long ago. But as during the Vietnam and Iraq Wars, getting in is much easier than getting out gracefully. Khalilzad has apparently presented Trump with a draft agreement that would withdraw thousands of American troops in exchange for the Taliban renouncing its ties with al-Qaida and other militant Islamist groups.

The agreement apparently doesn’t get a Taliban commitment to a detailed cease-fire agreement or negotiations for a power-sharing arrangement with the now U.S.-backed Afghanistan government. Those two U.S. objectives are likely pipe dreams.

With a now raging insurgency, the Taliban hold most of the cards in the negotiation, given that Trump has signaled that he is intensely interested in bringing U.S. troops home, likely before the November 2020 election. Furthermore, the Taliban have indicated that their goals are to be again the dominant force in Afghan society and to restore their previous male-controlled theocracy notorious for oppressing women. Thus, as the North Vietnamese did in the mid-1970s, the Taliban, in the worst case, are likely to ignore or just go through the motions with any cease-fire or negotiations with the Afghan government.

Despite this rather bleak outlook, the never-ending Afghan quagmire has cost America almost 2,500 soldiers’ lives and more than $1 trillion in a futile attempt to build Afghan democracy. The Trump administration should take the draft deal and run with it. The key provision is that the Taliban will renounce their ties with al-Qaida and other extreme Islamist groups.

Trump seems to be waffling a bit under pressure from a national security community that has had almost 18 years to get things right but has failed. He has already declared that he will leave some forces in Afghanistan to gather intelligence. But this might lead the Taliban to walk away from the deal entirely, because they want all U.S. forces out of the country.

The United States has sophisticated drones and other assets in space to detect any terrorist training camps. It doesn’t need permanent boots on the ground to gather intelligence. No more U.S. troops should give their lives when al-Qaida has long been hobbled and building an Afghan democracy is fool’s gold.

The United States needs to take the deal and finally bring American forces home.