It wasn't particularly graceful. It wasn't easy on the nerves. But it's just possible that the Trump administration has executed an important diplomatic pivot on North Korea — from chest-beating belligerence to an opening for negotiations.
Even before Trump came into office, Barack Obama warned him that his first international crisis might come from North Korea, the paranoid communist kingdom which has been steadily building nuclear weapons and missiles to carry them. By 2020, experts believe, the Pyongyang regime could have as many as 100 warheads, plus missiles capable of reaching California.
Trump and his aides got to work on the problem immediately — their attention compelled by persistent reports that Kim Jong Un was about to test a new, more advanced nuclear weapon.
The president made North Korea the top item on the agenda when he hosted China's leader, Xi Jinping, at Mar-a-Lago this month, saying he wanted more help in pressing North Korea to halt its nuclear program. China is North Korea's top trading partner and fuel supplier; no other country has as much leverage. But China has been lax in enforcing U.N. economic sanctions on Pyongyang.
Trump aides declared that Obama's policy of "strategic patience" was over. Another nuclear test, they warned, would lead to serious — but unspecific — consequences. Then the saber-rattling escalated.
On Twitter, Trump warned: "North Korea is looking for trouble. If China decides to help, that would be great. If not, we will solve the problem without them! U.S.A."
But after a brief but bracing war scare, national security adviser H.R. McMaster and Defense Secretary James N. Mattis swooped in to moderate the commander in chief.
"It's time for us to undertake all actions we can, short of a military option, to try to resolve this peacefully," McMaster, said on Sunday. "We are working together with our allies and partners and with the Chinese leadership to develop a range of options."
Note the phrase "short of a military option." Army officers who have been through difficult wars are rarely enthusiastic about starting new ones.
"We are working with international partners in order to defuse the situation," said Mattis, a retired Marine general. "But the bottom line is North Korea has got to change its behavior."
On Tuesday, Vice President Mike Pence echoed their calls for measures short of war. "All options are on the table, and there they will remain," he said in Tokyo. "But … the most productive pathway forward is dialogue among the family of nations that can isolate and pressure North Korea."
In the end, North Korea didn't test a new bomb — only a medium-range missile that failed.
But Trump and his aides succeeded at one thing: They got everyone's attention. "North Korea would do well not to test his resolve," Pence said.
That, however, was the easy part. Now the administration is turning to old-fashioned diplomacy to try to solve the impasse. The first step is working with China to impose tougher economic sanctions on North Korea. The aim is to force Kim Jong Un into negotiations with the ultimate goal of dismantling his nuclear enterprise, voluntarily or otherwise.
In exchange the United States — which has long sought to overthrow the Kim dynasty and its repressive regime — would gladly leave the young dictator in place.
"We want to resolve this issue through the peaceful denuclearization of the Korean peninsula," acting assistant secretary Susan Thornton said. "We're definitely not seeking conflict or regime change."
She told reporters that the administration isn't setting preconditions for negotiations, but wants some assurance that North Korea will be willing to "roll back" its nuclear arsenal.
That was one shade softer than the previous U.S. position, which demanded that North Korea dismantle its nuclear program entirely before talks could begin.
And it was a step in the direction of an outcome some experts think is most feasible: a freeze of North Korea's arsenal at its current stage in exchange for assurances that the United States will not attack the regime.
"All the options are bad," noted Robert S. Litwak of the Woodrow Wilson Center, author of "Preventing North Korea's Nuclear Breakout." "But a negotiated freeze is the least bad outcome available."
North Korea might accept a freeze of its nuclear arsenal, he argues, because it would preserve its military deterrent against foreign attack. China might support that outcome because it doesn't want a more powerful North Korea any more than we do. And for the United States, a freeze is at least better than facing down missiles that could reach California.
"We would have to swallow hard," Litwak told me. "But if you can't get to zero nuclear weapons, a freeze at 15 is better than going to 100. We could describe it as an interim step toward the ultimate goal of total denuclearization."
That kind of diplomacy won't be easy. North Korea, surrounded by enemies, will demand economic and security guarantees.
And it will pose a test for Trump: Is a president who achieved fame by claiming to be a "winner" capable of settling for an unpalatable but war-averting compromise? There isn't much time to find out; 2020, when Pyongyang could have intercontinental missiles, is only three years away.