Given the uptick in violence, at several points during the talks Taliban leaders struggled to resist pressure from their rank and file to stop negotiating. Taliban leaders pressed ahead believing the talks could yield an agreement on the departure of foreign forces, one of their main aspirations.

Direct talks between American officials and Taliban leaders throughout this year have done nothing to diminish violence. Even as the two negotiating teams appear to have moved toward agreement on a timeline for the withdrawal of American troops and for the Taliban preventing the use of Afghanistan as a base by international terrorists, levels of bloodshed have risen.

Airstrikes and offensives by the American and Afghan government forces on one hand, and Taliban offensives and attacks on the other, have increased at the same rate as progress in the negotiations. This is hardly unique to Afghanistan: Violence is often used to gain negotiating leverage ahead of peace talks.

American diplomats have pressed for a cease-fire during talks. But Taliban leaders reject the idea, reluctant to jeopardize their military capability, which they see as their main source of leverage in reaching a deal with the United States not only on the withdrawal of foreign forces but also a wider settlement reached among Afghans enabling the Taliban to become part of a new political order. They may fear that the insurgency’s ranks, once the fighting stops, would be hard to fire up again.

At least some Taliban commanders who had been prepared to give talks the benefit of the doubt now discreetly reproach their envoys for wagering too much on the United States and failing to consider what they now see as American unreliability.

But the door has not closed shut. President Trump still has a historic opportunity to help end America’s longest war. Both the Taliban and Washington want the American military presence in Afghanistan to wind down. It will be important that any deal the United States makes should focus not just on conditions for troop withdrawal but also on laying the ground for successful intra-Afghan talks. American diplomats must subsequently vest as much effort in supporting those talks as they have in trying to secure the bilateral deal.