US President Donald Trump's timing in withdrawing from the Iran nuclear deal could hardly have been more inauspicious.
At the moment he announced the decision, his new secretary of state was on a plane to North Korea, headed for discussions about denuclearisation that will make the Iran deal look simple.
Experts were already warning about the difficulties in reaching a deal that Trump would be happy with and Kim Jong Un could live with, let alone the tricky task of verifying that North Korea is actually complying with it.
That task will be even harder now, analysts say. But it doesn't necessarily mean that Kim will lose interest in bargaining.
After all, he wants the same thing that Iran got, even if it turns out to be only for a few years: relief from the sanctions that are crippling his economy.
Secretary of State Mike Pompeo and Kim made "substantial progress" during a 90-minute meeting in Pyongyang, a US official travelling with Pompeo said. Trump and Kim plan to meet face-to-face in the next month or so, although the date and location have not yet been announced.
But Trump's withdrawal from the Iran accord could undermine American credibility in a country that already distrusts the US with an unparalleled passion.
"There's no question that Trump's refusal to follow through on our commitments to the deal will negatively impact any attempt to reach an agreement with North Koreans," said Suzanne DiMaggio, a senior fellow at the New America Foundation who was heavily involved in the Iran agreement and has since had several meetings with North Korean officials.
"By abandoning the Iran deal, Trump is sending a terrible message to Kim Jong Un: even if you carry out your commitments to the letter and do not cheat, you still cannot rely on the US to deliver what it has promised," she said.
The 2015 Iran deal looked, in many ways, like a blueprint for an agreement with North Korea.
The outside world wants the Kim regime to give up its nuclear weapons. The Kim regime wants the punishing sanctions lifted, or at least eased.
Iran had agreed to put in place a system whereby it would operate only a peaceful nuclear programme, and allow international inspectors to verify that, in return for sanctions relief.
"The North Koreans have viewed the Iran agreement as a diplomatic road map to sanctions relief and other concrete economic benefits," DiMaggio said.
But even before Trump's announcement yesterday, any North Korea deal was already looking to be much more complicated than the Iran accord.
"Iran did not have nuclear weapons. They had missile technology but they did not have a delivery system. North Korea has a weapons programme and a delivery system," said Wendy Sherman, Washington's lead negotiator on the Iran agreement, and someone who had previously dealt with North Korea during the Clinton Administration.
Although Trump's decision has complicated the diplomatic process, few analysts expect Kim to just walk away from the negotiations.
"I tend to think that Kim Jong Un will negotiate a deal based on his interest," said Kelly Magsamen, who worked on both Iran and North Korea during the Obama Administration and is now at the Centre for American Progress.
Right now, he has shown that his interest lies in fostering growth in his languishing economy. To do that that, Kim needs China to ease up on the sanctions imposed in the wake of last year's nuclear test and missile launches, which have cut off the regime's ability to earn foreign currency.
That Kim is set to met Trump within the next month or so will also limit the short-term impact of the Iran decision, said Se Young Jang, a nuclear policy scholar at the Carnegie Endowment for International Peace.
"Under this tight time schedule for the upcoming Trump-Kim summit, the immediate focus of the North Koreans will be on what Trump can offer them in return for denuclearisation, not on the US pull-out from another deal," she said.
And North Korea will not get whiplash from a change in administration. It has already experienced what Iran went through yesterday.
In 2000, the Clinton Administration seemed on the brink of a breakthrough in relations with North Korea. Then George W. Bush came in and branded the country part of an "axis of evil."
"North Korea has long understood the volatility of dealing with a democratic government that changes administrations every four or eight years," said Catherine Killough of the Ploughshares Fund, a foundation that advocates for nuclear disarmament. "So while I am totally mourning the Iran deal, I'm not yet mourning the prospects for a new deal with Korea."
North Korean officials understand Trump has a unique approach to the presidency. They have read Trump's The Art of the Deal and will know that the President thinks only he can strike a good deal.
That is why they believe that any agreement he brokers with North Korea will in his eyes automatically be a good one - just as the Iran deal was automatically a bad one.
But further down the road, there could be broader implications for the effort to convince North Korea to give up its nuclear weapons.
For one, Trump's Iran decision could strengthen North Korea's bargaining power, said Kelsey Davenport, director for nonproliferation policy at the Arms Control Association.
"I'm worried that walking away from the Iran deal will make Trump more desperate for a dramatic breakthrough at the summit with Kim Jong Un, so he can prove that he is the 'master of the deal'," she said. "So I think it increases North Korea's leverage, not Trump's."
For another, it could anger China, which signed onto the Iran deal and is key to enforcing sanctions imposed on North Korea. About 90 per cent of North Korea's trade goes to or through China.
"This creates yet another friction point with the Chinese, who we need to keep pressure on the North Koreans to bring them to the table, at a very complicated time," said Magsamen.
"And if the president is not successful with North Korea, we're going to need the international community behind us on sanctions," she said.