SEOUL (AFP) - US President Donald Trump's withdrawal from the Iran nuclear deal is a blow to Washington's negotiating credibility and will complicate efforts to reach an agreement with Pyongyang over its own more advanced weapons programme, analysts say.
Trump is set to hold an unprecedented summit with North Korean leader Kim Jong Un in the coming weeks to negotiate over Pyongyang's arsenal, after it last year carried out by far its most powerful nuclear test to date and launched missiles capable of reaching the US mainland.
In a goodwill gesture ahead of the summit, North Korea on Wednesday freed three American detainees, allowing them to return home with US Secretary of State Mike Pompeo.
But the US president's decision on Tuesday (May 8) to pull Washington out of the 2015 accord with Teheran has rattled experts, who say it undermines the image of Washington as a reliable treaty partner.
Antony Blinken, who was deputy secretary of state under Barack Obama, said the White House move "makes getting to yes with North Korea that much more challenging".
"Why would Kim... believe any commitments President Trump makes when he arbitrarily tears up an agreement with which the other party is complying?" he asked on Twitter.
Trump poured scorn on the "disastrous" Iran agreement, describing it as an "embarrassment" to the United States - although European signatories and the IAEA watchdog say Iran has complied with its obligations.
MIT political science professor Vipin Narang said the decision was "a stark reminder across the world: Deals are reversible and can have expiration dates, while nuclear weapons can offer lifetime insurance".
North Korea remains technically at war after the 1950-53 Korean War ended with a ceasefire rather than an armistice, and Pyongyang has long insisted that it needs nuclear weapons to defend itself from a possible US invasion.
Two weeks ago Trump's new national security advisor John Bolton said, "We have very much in mind the Libya model," for the denuclearisation of North Korea.
Libyan leader Moamer Kadhafi agreed to abandon his pursuit of nuclear weapons in the early 2000s, but his government was later overthrown by rebel forces supported by Western air strikes, and he was killed.
Pyongyang regularly cites the fates of Kadhafi and Saddam Hussein in Iraq - whose government was overthrown in a US-led invasion - as evidence of the need for nuclear arms.
Former Central Intelligence Agency director John Brennan said Trump's "madness" had "undermined global confidence in US commitments, alienated our closest allies, strengthened Iranian hawks, and gave North Korea more reason to keep its nukes".
Some were more sanguine.
Pyongyang was concerned about the sustainability of a deal and sees democratic changes of government as a "structural weakness that imperils agreements by any one White House", said Yonsei University professor John Delury.
But he added: "They'd be worried less about Trump pulling out of a deal than his successor." Bolton himself said the US was looking for a "real deal" with Pyongyang that would include "the elimination of both the front and the back end of the nuclear fuel cycle; no uranium enrichment; no plutonium reprocessing".
"When you're serious about eliminating the threat of nuclear proliferation, you have to address the aspects that permit an aspiring nuclear weapons state to get there," he said at a press briefing.
"The Iran deal did not do that. A deal that we hope to reach, the President is optimistic we can reach with North Korea, will address all those issues."
The unilateral nature of Trump's move is likely to worry officials at the Blue House in Seoul.
The decision was made despite repeated personal pleas by European leaders and cast aside more than a decade and a half of careful diplomacy by Britain, China, France, Germany, Iran, Russia and past US administrations.
South Korean President Moon Jae In has been widely praised for seizing the opportunity presented by the Winter Olympics to broker talks between Trump and Kim - two leaders who were at loggerheads just months before, and threatening to wage a war which would inevitably devastate the South.
But the fate of the Iran deal suggests Trump could also dismiss pleas from Seoul - a treaty ally - in future.
Analysts pointed to Kim's recent trips to China as evidencePyongyang was looking for support from Beijing and to repair frayed relations with its longstanding diplomatic protector and provider of trade and aid.
Kim, who had not ventured out of his isolated country for any official meetings in his first six years in power, has held two rounds of talks with President Xi Jinping in little more than a month.
"North Korea has been fully aware of the risks of the US walking away from any deal whenever its government changes hands," Koh Yu-hwan of Dongguk University told AFP.
"In order to hedge against this eventuality, Kim Jong Un met Xi Jinping twice to obtain a firmer security guarantee from China before he enters a deal with the US."
And Pyongyang wanted wider assurances, he added.
According to China's official Xinhua news agency, Kim told Xi that "relevant parties" should "abolish their hostile policies and remove security threats against the DPRK".
"This means the North is seeking a global commitment to a deal with the US to prevent the US from unilaterally rolling it back," Koh told AFP.