It will take some time to piece together the strange story of the U.S.-North Korean summit that has been on, then off, then maybe on again. President Trump laid down a smokescreen by speaking, including in his letter announcing his cancellation of the meeting, as if it were the North Korean side that bailed out. Trump referred in his letter to “the tremendous anger and open hostility displayed in your most recent statement.” Are we supposed to believe that the administration really was taken aback by hostile rhetoric from North Korea? Hostile rhetoric has long been one of that country’s principal exports, along with coal. Kim Jong-un has not even returned to calling Trump a dotard, although Trump in his letter returned to boasting about how his nuclear force is much bigger than Kim’s.

Second thoughts about proceeding with the meeting had been percolating in the administration, amid the major uncertainties about whether there was any basis for a meaningful agreement on nuclear matters. Still in doubt is what part of the story is Donald Trump, what part involves other figures in his administration, and how much they are even pulling in the same direction. One plausible theory of why the “Libya model” was originally raised by John Bolton, who is smart enough to know that any such reference would rile the North Koreans, is that the uber-hawk was sabotaging the diplomacy to increase the chance of a military attack. But then Vice President Mike Pence made his own reference to Libya. A plausible interpretation of Pence’s remark is that it was calculated to elicit just the sort of comeback it did (from North Korea’s deputy foreign minister), which would sound hostile and angry enough to serve as a rationale for cancelling a meeting that Trump had come to regret he had accepted.

Libya’s experience does indeed weigh heavily on the thinking of North Korean officials, who have taken explicit notice of that experience, as a disincentive to reaching any deals with the United States about dismantling weapons programs. Muammar el-Qaddafi’s eventual reward for negotiating away all his unconventional weapons programs was to be murdered in a ditch.

There are other respects, however, in which the Libya model helps to explain the collapse of the North Korea diplomatic initiative. This part of the explanation concerns how the Trump administration is not following that model—the good part of that model, the part in which Libya was induced to give up its unconventional weapons programs, not the later part about the killing in the ditch.

The Libya story concerned more than just nuclear and other unconventional weapons programs. A greater focus for much of that story was terrorism. International sanctions on Libya that the United Nations Security Council imposed were linked to a specific demand: the surrender for trial of the two Libyan government employees who perpetrated the bombing of Pan Am Flight 103 in 1988, killing 270 persons. Once Qaddafi surrendered the two, he said to the United States through an intermediary, “Let’s talk.” Turning over the Pan Am 103 suspects was the start of what the Libyan leader saw as a major turnaround in his policies, leading, he hoped, to an end to his pariah status.

This contact led to U.S.-Libyan talks, very closely held at the time and only later revealed publicly, beginning in 1999 during Bill Clinton’s administration. This was the start of a long and careful process of each side feeling out the other to discern its true intentions. The United States needed to determine whether Qaddafi was serious about turning over a new leaf. It assessed that he was. On terrorism, a Libyan regime that had been a big a part of the problem for many years could become part of the solution. Qaddafi regime was a target of some for the same radical Islamist groups that also were counterterrorist concerns of the United States.

The Libyan-U.S. rapprochement continued at a careful and measured pace. Expanding the agenda to weapons programs introduced new complications. It was only after four years of off-and-on negotiations that the United States (then under the George W. Bush administration), Britain, and Libya announced an agreement. The agreement accomplished everything the Western powers could have hoped for with regard to the Qaddafi regime opening up and giving up its nuclear and other unconventional weapons programs.

That diplomacy succeeded in large part because it was everything that the Trump approach toward North Korea has not been. The Libyan diplomacy involved careful preparation and assessment before any contacts or even any agreements to meet. Once meetings began, the process was not allowed to get ahead of careful appraisal of the other side’s intentions and whether the bargaining space would permit an agreement. The most important diplomacy was conducted out of sight, with even the fact of it kept secret. Demands were kept realistic in terms of what the evidence indicated would be acceptable to the other side. The diplomacy was sustained over a long time, through two different U.S. administrations of different parties.