After 18 years of war, the United States had a fighting chance at ending the longest continuous conflict in its history. A deal was within reach with the Afghan Taliban. Zalmay Khalilzad, the U.S. special representative for Afghanistan, had spent months shuttling between Doha, Kabul, and Washington, slowly putting the pieces together for an end to hostilities and a phased U.S. withdrawal. There was reportedly finalized text for an agreement, initialized by representatives of both sides. After hundreds of billions of dollars spent, more than 2,300 American combat deaths, and an estimated 150,000 civilian deaths, President Donald Trump stood poised to achieve what eluded the Bush and Obama administrations: He could effectively end the American war in Afghanistan.

You could tell that Trump had no appreciation for the significance of that achievement by how swiftly he blew it up this weekend. In a series of tweets on Saturday evening, Trump claimed that he was calling off a secret Camp David meeting with Taliban representatives and Afghan President Ashraf Ghani, following a Taliban-claimed attack in Kabul that killed a U.S. service member, a Romanian soldier, and ten Afghan civilians last week. “If they cannot agree to a ceasefire during these very important peace talks, and would even kill 12 innocent people, then they probably don’t have the power to negotiate a meaningful agreement anyway,” Trump added.

That was a lot to digest. Trump called for U.S. withdrawal from Afghanistan early and often before he became president, and has expressed skepticism about the American mission there ever since. But he had also lambasted Obama, his predecessor, for “negotiating with our sworn enemy the Taliban,” and so the news that he had planned to host representatives of the Taliban in Maryland around the anniversary of the September 11, 2001 attacks, then scrubbed the plan, then spilled about it on Twitter, was dizzying for critics, supporters, and administration officials alike. As with his waffling last year on North Korean negotiations and his sharing of a classified spy-satellite photo on Twitter last week, this was another example of Trump oversharing and throwing a wrench in the diplomatic works for no apparent reason other than his self-aggrandizement. And in the case of the Taliban talks, it may have been a lie of Trumpian proportions that could lead to thousands more deaths in coming months.

The New York Times on Sunday evening published an inside account of how exactly a potential deal with the Taliban hit a brick wall. The most remarkable bit—one that’s familiar to anyone who’s followed Trump’s diplomacy with North Korea—is why the president felt the need to kneecap his special representative’s months of yeoman’s work negotiating with the Taliban. In late August, White House officials suggested to Trump that the parties “finalize the negotiations in Washington, a prospect that appealed to the president’s penchant for dramatic spectacle,” in the Times’ words. Taliban officials, seeking political legitimacy, agreed to travel to the U.S. in principle, “as long as the visit came after the deal was announced.”

That was hardly an unusual request, as high-level negotiations go. It was how the North Korea playbook used to work in the Clinton, Bush, and Obama years: If Pyongyang’s representatives came to the table and hammered out a substantive deal in good faith at the working level, they might be rewarded with a presidential photo-op only when an agreement was finalized and signed.