In an ironic twist, President Donald Trump’s diplomatic progress in North Korea may have played a major role in his decision to withdraw from the Iran nuclear agreement. The decision to withdraw the United States from the hard-won multinational Joint Comprehensive Plan of Action “sends a critical message,” the US president said on Tuesday. “The United States no longer makes empty threats. When I make promises, I keep them.”

Trump’s Iran announcement came earlier than expected – four days ahead of a May 12 deadline – and he made a point of mentioning that Secretary of State Mike Pompeo was on his way to North Korea “at this very moment.” On Wednesday, Trump tweeted that the three Americans detained by Pyongyang had been released and were on their way home with Pompeo.

It seems clear that, from Trump’s perspective, the Iran deal and the diplomatic advances with North Korea are closely related – and that his policy of “maximum pressure” is paying off. In the administration’s view, measures like crippling US-led sanctions against Pyongyang’s critical industries brought North Korean leader Kim Jong Un to his knees – and the same policy should work with Tehran, as well. On the day of the landmark summit between Kim and South Korean President Moon Jae-in, Trump posted a tweet suggesting he deserved credit for the historic development. “KOREAN WAR TO END! The United States, and all of its GREAT people, should be very proud of what is now taking place in Korea!” he wrote.

Trump may also have been emboldened to act more punitively against Iran because it lacks North Korea’s powerful intermediaries. As Trump acknowledged in another tweet, the Korea opening was in part facilitated by neighbouring China, which joined other members of the UN Security Council in tightening economic sanctions against the Kim regime in spite of Beijing’s long trading and political relationship with Pyongyang. In Iran’s case, its closest current ally is Russia. However, tensions between Washington and Moscow are running high right now and Russian President Vladimir Putin does not, in any event, have enough influence on Tehran to shape its foreign policy behaviour.

It’s true that European powers tried to save the JCPOA by proposing a package that addressed Trump’s concerns about the agreement. However, European leaders did not really do much to salvage the deal beyond trying to coax Trump into remaining in it, or – worse yet from an Iranian point of view – appeasing Washington at Tehran’s expense. As a consequence, Europeans are no less despised and distrusted in Iranian decision-making circles these days. Pertinently, North Korea believes it can at least rely on China as a buffer against potential US aggression; Iran does not have a similar faith in Europe.

Trump’s tough line on Iran, of course, was intended for an audience beyond Tehran. The US president’s decision plays to his populist base and serves as a rallying cry for some of his critics in the Republican establishment. It also, as National Security Adviser John Bolton spelled out after Trump’s speech, sent a message to North Korea that “the United States will not accept inadequate deals.” That warning could bring yet another ironic twist. While Trump’s withdrawal from the Iran nuclear deal might be intended to show Kim Jong Un that the US president follows through with his threats, it may also reinforce fears that Washington’s negotiations cannot be taken seriously – and that Pyongyang still needs its nuclear deterrent to ensure its survival.