U.S. NEGOTIATORS are reportedly racing to complete a flimsy peace accord with Afghanistan’s Taliban insurgents in the coming days before President Trump unilaterally announces a U.S. troop withdrawal. If so, they and Mr. Trump are repeating the mistake for which they long blamed President Barack Obama — committing to troop pullouts from conflict zones without first ensuring that the result is not a military and political disaster. While an accord that ends Afghanistan’s decades of war — and the nearly 18-year-old U.S. mission — is much to be wished for, it should not happen on the terms Mr. Trump appears prepared to accept.

According to reporting by The Post, the agreement negotiated by State Department envoy Zalmay Khalilzad would mandate a withdrawal of the 14,000 U.S. troops in Afghanistan, along with detachments from NATO allies, in exchange for a Taliban commitment to break with al-Qaeda, with which the Taliban has been deeply intertwined since before the attacks of Sept. 11, 2001. Mr. Trump is reportedly itching to announce the first redeployment of 5,000 U.S. troops, which by some accounts is already in preparation, and is pushing for a complete withdrawal before the 2020 election.

Mr. Trump’s politically motivated zeal resembles that of Mr. Obama, who in 2011 insisted on a full U.S. withdrawal from Iraq, ignoring warnings — later tragically proved correct — that it could lead to the resurgence of jihadist movements there. In the case of Afghanistan, the potential bad consequences are even easier to foresee: the collapse of the Western-backed Afghan government; reimposition by the Taliban of a draconian dictatorship that denies fundamental human rights, especially to women; and the strengthening of extremist groups, including an Islamic State affiliate that already commands thousands of fighters.

According to accounts of the emerging agreement, the protections negotiated by Mr. Khalilzad against such an outcome are weak — and have deteriorated amid the unreasonable rush to conclude a deal. The Taliban reportedly would agree to negotiations with the Afghan government about a political settlement, and there would be some commitment to a cease-fire. But according to The Post’s reporting, neither provision is detailed or clear-cut. It’s not certain that the insurgents would accept direct talks with President Ashraf Ghani, who has been excluded from the peace process so far. And U.S. officials concede that fighting would probably not stop immediately.

Though most Americans wish to end the Afghan mission, there is little reason to abandon the country in haste. Of the more than 2,300 Americans killed in Afghanistan since 2001, 15 had died through July this year, and 53 since the drawdown in 2014. If the result of a quick withdrawal is the collapse of the government and the reestablishment of sanctuaries for terrorists, the United States could be dragged back into the conflict at a far greater cost — as happened in Iraq three years after the pullout. That’s not to mention the loss of all that this country has invested, in lives and treasure, in helping to build Afghanistan’s democratic political system and extend basic rights to women.

An acceptable agreement with the Taliban would condition the final withdrawal of U.S. troops on a settlement between the insurgents and the Afghan government. It would also provide for a continuing presence of U.S. counterterrorism forces to strike the Islamic State and other emerging terrorist threats. If Mr. Trump agrees to a pullout that omits such requirements, he will risk turning what could still be a successful outcome for the United States in Afghanistan into a shameful failure.

Read more: