The latest North Korean nuke test undoubtedly constituted a major morale-booster for Iran. It could not imagine a more uplifting object lesson.

The parallels between Tehran and Pyongyang are obvious – two rogue states that covet nuclear weaponry, defy the rest of the world, are fired by extremist and expansionist ideologies, conduct spurious negotiations and appear inured to international sanctions.

North Korea has been subjected to sanctions longer than any other country. Yet the citizenry’s near-starvation is hardly the highest priority for Pyongyang’s tyrants.

Tehran’s ayatollahs aren’t more caring. Neither regime is likely to back down out of compassion for its suffering masses.

Moreover, the two collude chummily. North Korea has assisted Iran’s nuclear program and Iranian scientists were invited to witness the Korean tests. Pyongyang’s pattern of suckering the West is clearly not lost on Tehran.

Iranian uranium upgrading had proceeded steadily along while its diplomats bought time in pseudo-negotiations.

Nevertheless, another round of futile talks is due to begin in Kazakhstan. US President Barack Obama has decried the third North Korean nuclear test as “provocative,” while he insists on pursuing a diplomatic solution with Pyongyang’s matching twin – Iran.

It is as if the North Korean and the Iranian sagas were played out in separate, unconnected bubbles. It is as if the world’s democracies deliberately don blinders. This is foolish. The Iranian plotline is closely modeled on the North Korean precedent, where America’s failure was especially phenomenal.

Pyongyang had hoodwinked Washington, and Iran learned that it is possible to get away with the most outrageous deceit. Indeed, it learns that nuclear bombs can be used for extortion, that a nuclear power becomes invulnerable to pressure and that it can impudently use its arsenal to demand the removal of sanctions. Rather than deter Iran, the North Korean example emboldens it.

America assumed it had won North Korean cooperation for a disarmament process after the first North Korean test in 2006. By 2008, though, it became clear that the Yongbyon nuclear facility was again abuzz with activity. After further haggling, another disarmament deal was struck in October 2008. International Atomic Energy Agency inspectors were to be allowed to conduct forensic tests of nuclear materials. North Korea was removed from America’s “State Sponsors of Terrorism” list.

But on May 25, 2009, North Korea carried out another nuclear test, thereby thumbing its nose at the US. This was followed up by long-range missile tests. The latest bomb tested can reportedly be fitted into a missile’s warhead.

Now, as in 2009, the singular consolation for Washington was that both Russia and China condemned the Pyongyang insolence. But what of it? These two effectively breach the sanctions against North Korea. Their attitude to the sanctions imposed on Tehran is almost an exact replica.

So much for making progress on the diplomatic track and avoiding confrontation at all cost. Rogue regimes regard Western lenience as weakness, and the weak are humiliated. But it is not just a question of honor. The safety of humanity as a whole has been severely compromised by irresolution that can only be likened to pre- World War II appeasement.

North Korean nuclear technology is for sale and the identity of the highest bidder does not matter. The nuclear reactor that Israel destroyed in Syria was a notable North Korean export. Additionally, North Korean ballistic missiles are in the unreliable hands of Iran, Egypt and teeter-tottering Syria, to name just a few.

It is hardly impossible that a variety of nuclear devices could find their way to terrorist outfits such as Hezbollah or al-Qaida – either directly of via fronts. No nation, anywhere, would be immune from the consequences. North Korea had broadcast a video in which the flattening of New York City by nukes is simulated.

Pyongyang had no qualms about reneging on its obligations almost as soon as seeming accommodation was reached. Iran is equally adept at making mockery of Western envoys. Nonetheless, Obama apparently trusts that suave diplomats can cool the Iranians’ ardor to harness nukes in the service of fanatical Islam.

The Korean genie can no longer be pushed back into the bottle, but the Iranian genie has not yet fully sprung out.