As recently as Wednesday afternoon, Secretary of State Mike Pompeo insisted that "all across the administration" preparations were steaming along for a historic summit between President Trump and North Korean leader Kim Jong Un.
Less than 24 hours later, Trump abruptly canceled the meeting, citing the "tremendous anger and open hostility" in statements from Pyongyang.
In the end, former and current government officials said, the cancellation may have saved Trump from a meeting in which the goal he had set appeared increasingly unlikely to be achieved and the risk of being outfoxed by the young North Korean leader seemed unacceptably high.
"Although North Korea has made ominous threats that the president had to respond to, I also think the president used these threats to tank a summit that was ill-prepared," said Wendy R. Sherman, a former deputy secretary of State in the Obama administration, who, as an ambassador, participated in negotiations with North Korea in the 1990s and early 2000s.
With the summit less than three weeks away, the Trump administration and North Korea had not agreed on the meaning of "denuclearization" -- the objective Trump had aimed for. Major negotiating points, such as conditions, incentives, a timeline and what kind of phase-out of weapons might take place had not been resolved.
Trump had already given a major concession by agreeing to meet Kim before any of the diplomatic spadework was accomplished. He had also publicly praised the North Korean leader, reversing the harsh rhetoric he used last summer.
"The problem has always been that this process is all backwards," said Robert A. Manning, a former intelligence analyst now at the Atlantic Council think tank. "Usually a summit comes after both sides have taken certain steps."
The process had already given Kim several victories, from his perspective. In domestic propaganda, the agreement to meet, and Trump's praise, had reinforced his well-crafted image as a powerful and benevolent leader. He gained a large dose of international recognition, a sort of legitimacy that the long-isolated country never had, from his two meetings each with Chinese President Xi Jinping and South Korean President Moon Jae-in as well as the invitation to meet with Trump.
Kim would have liked more — the North Koreans want relief from the punishing economic sanctions that the U.S. and other countries have put in place. But recognition on the global stage has long been a paramount goal.
The North Koreans did make a splashy concession of their own — detonating explosives on Thursday which they said had destroyed the tunnels at Punggye-ri, the underground site used for their six nuclear tests.
Longtime Korea analysts, however, discounted that, noting that it resembled a similar move in 2008. At that time, North Korea invited television journalists to broadcast the demolition of the cooling tower at its nuclear reactor to show that it was committed to denuclearization. The reactor was restarted a few years later, using a different cooling method.
Experts say that North Korea could rebuild the tunnels in as little as three months.
Even without restarting the tests, Kim can rest on his laurels for now. Until a new summit is scheduled — still a possibility — he doesn't have to worry about being asked to give up his nuclear arsenal, a demand that most Korea experts believe he never had the intention to comply with.
The whiplash nature of Trump's foreign policy clearly also was a factor in the return, for now, to a stalemate.
The administration "doesn't understand what it takes to deal with these people," said Joel Wit, a former diplomat who was one of the negotiators on the 1994 agreed framework under the Clinton administration, but who nevertheless supported Trump's North Korea initiative.
The administration's lack of understanding "is reflected in Trump's public statements and his veering from unadulterated praise of Kim Jong Un to recent statements that have been much more negative," Wit said. "You just can't do it that way."
Despite the cancellation, Trump's letter left room for a summit to be scheduled at a later date. With that in mind, both sides may decide to avoid rushing to a confrontation, although given the unpredictability of both men, nothing can be ruled out.
If the North Koreans choose to escalate, Kim could launch a missile to prove that he still can. Trump could return to the bellicose language about Kim he was using last year, which seemed to leave little room for diplomacy.
In his letter to Kim, Trump gave a taste of that.
"You talk about your nuclear capabilities, but ours are so massive and powerful that I pray to God they will never have to be used," he wrote.
Pompeo, who was testifying before the Senate Foreign Relations Committee, was asked what would come next in dealings with North Korea. Several Democrats appeared unsatisfied with his answer.
"I don't know what to say other than there has been an incredibly effective global campaign [of sanctions] to create pressure on the North Korean regime" and prevent it from being a threat, Pompeo said.
The threat to the U.S. "existed yesterday, it exists today, it's likely to exist tomorrow and so our process remains the same," he said.
Some analysts said Trump had raised expectations unreasonably high by speaking of immediate "complete denuclearization" and repeatedly mentioning he might win the Nobel Peace Prize.
Others said Kim was playing Trump all along.
"This is part of their campaign to sabotage our maximum pressure campaign,'' said Anthony Ruggiero, a former Treasury Department official who specialized in financial sanctions. "Now they'll say: 'Hey, we wanted to go to the summit. We even got rid of our nuclear test site. It's the Americans who cancelled.'''
Duyeon Kim, a visiting senior fellow at the Korean Peninsula Future Forum in Seoul, said it would have been embarrassing for Trump to walk into a summit after Pyongyang insulted Vice President Mike Pence, calling him stupid. A meeting between the two leaders is still possible, she said, if North Korea doesn't continue provoking Trump's administration.
Pence, on Wednesday, echoed John Bolton, Trump's hawkish national security advisor, in suggesting the "Libya model" was the appropriate scheme for getting rid of Pyongyang's nuclear weapons.
Libyan leader Moammar Kadafi agreed in 2003 to shed his nuclear program, which had not yet produced a weapon, in exchange for economic and trade benefits from the West. But as the North Koreans are well aware, within less than a decade, western nations backed rebels who overthrew Kadafi and killed him.
Several national security experts in touch with the White House said they did not believe Bolton had been trying to sabotage the summit with his Libya references. But he was working to prevent Trump from acting too impulsively and to keep him from getting swept away by the prospect of a big deal, said a former national security official in George W. Bush's administration who remains in regular touch with the White House.
"There's this dynamic, this internal tension between John Bolton, who's spent his whole career deeply skeptical of negotiating with rogue regimes and a president who is rightfully or wrongly fixated on the big picture," said the former official.
The biggest loser in the cancellation is South Korea's Moon, whose statements indicated that he had been blindsided by the decision to scrap a summit behind which he was the main moving force. South Korea had to call an emergency security meeting in the middle of the night when the Trump letter became public.
"In a contest of who can be the most erratic leader, President Trump beats Kim Jong Un hands-down," Wit, the former negotiator, said later via Twitter. "His unsteady hand has left everyone scratching their heads, including our [South Korean] allies. No one knows where this is going to lead, but it will not be good for the United States."
Demick reported from New York. Staff writer Noah Bierman in Washington and special correspondent Matt Stiles in Seoul contributed.