Days before North Korea reported that it had conducted its first-ever nuclear test, it stated why it would defy the world to join the nuclear club.
"The US extreme threat of a nuclear war and sanctions and pressure compel [North Korea] to conduct a nuclear test," the Foreign Ministry in Pyongyang warned last week.
That reasoning resonates in Tehran – even though comparisons are limited between North Korea and Iran, which is still a signatory to the Nuclear Non-proliferation Treaty (NPT).
"More pressure [from the US] against Iran will accelerate the nuclear project of the country," says Saeed Laylaz, a political and security analyst in Tehran who says that American actions will determine Iran's strategic choices.
"Because the regime is convinced that the US wants to [change the regime], they believe they have a temporary opportunity to protect themselves [using] a nuclear program as a shield," says Mr. Laylaz. "If the US can convince [Iran] they are not going to collapse the regime ... then they will be ready to cooperate much better and more constructively than now."
Iran ignored an Aug. 31 UN deadline to suspend uranium enrichment. A sanctions resolution was to be worked out this week, before the North Korea test.
Months of negotiations that included a broad incentives package have stalled over demands that Iran first suspend enrichment. While restating its position Tuesday that all nuclear weapons should be abolished, Iran has been virtually alone in not calling for tough sanctions against North Korea, or condemning the test.
"North Korea's nuclear test was a reaction to America's threats and humiliation," Iran's state-run radio said. "Not only did the United States not lift the sanctions it had imposed ... it even increased the diplomatic pressure. Such pressure finally led North Korea to conduct its nuclear test."
Some defense analysts have warned of a similar dynamic taking root in Iran, especially under the nationalist leadership of President Mahmoud Ahmadinejad, who has repeatedly said Iran would not give up nuclear technology.
"Logically speaking, it does make sense for Iran to explore how it can maximize its security benefits from the current nuclear discussion," says Kaveh Afrasiabi, a past adviser to Iran's nuclear negotiating team, contacted in Boston.
"The threshold will come if there is an escalation of the security situation, prompting Iran to set aside its misgivings about nuclear weapons," says Mr. Afrasiabi.
"It all boils down to questions of national security," says Afrasiabi, adding that Iran sees reason to fear the US presence in Afghanistan and Iraq. "It is unrealistic to expect that Iran would not feel any security paranoia as a result of these military build-ups, and there is no sign of it abating."
Comparisons are limited between North Korea – which withdrew from the NPT in 2003, kicked out UN inspectors, and stated its weapons ambitions – and Iran, which says it aspires only to peaceful nuclear power.
Both have been targets of US-led pressure that has grown since President Bush lumped them in his "axis of evil" with Iraq. But countries like China and Russia have balked at imposing sanctions.
A host of Western officials expressed frustration with Iran last week. Top European negotiator Javier Solana warned that his "endless hours" of talks had been fruitless: "This dialogue ... cannot last forever, and it is up to the Iranians now to decide whether its time has come to an end."
Experts point out key differences in the two cases. For years, North Korea has been much further along in its programs, and Western intelligence has long believed that Pyongyang had enough highly enriched uranium for several nuclear devices.
By contrast, Iran froze its fledgling enrichment activities for 2-1/2 years while it negotiated with Britain, France, and Germany. Those talks failed, and last April, Mr. Ahmadinejad announced that Iran had achieved low-level enrichment of a few grams of uranium – a step that could fuel a reactor if done on an industrial scale.
But Iran and North Korea focus on expanding ballistic-missile programs. Iran's Shahab series is based on North Korean designs and expertise. Missile tests in July further isolated Pyongyang; recent tests by Iran have also raised eyebrows.
It is also widely believed that North Korea has passed on nuclear and other scientific know-how; North Korean experts in the construction of reinforced underground bunkers visited Iran late last year.
"Iran has been very careful to match outside pressure with incremental, small steps," says a veteran political analyst in Tehran. But if the West "increases pressure in a tangible way – such as sanctions or an oil embargo – there could be a strategic change, because surrender is out of the question with this present government."
If pressure grows "from many sides, and Iran is completely isolated," says this analyst, "it would give the upper hand to [factions] that seek some kind of extraordinary thing as a deterrent, like a bomb."
Still, Iran understands the risks of following North Korea, though nearby Israel, Pakistan, and India all have nuclear arsenals. They are "well aware there would be a domino effect, and a nuclear arms race in their own region," says Afrasiabi.
"The North Korea crisis has been manna from heaven for Iran," says Afrasiabi. "It puts Iran on the back burner, and the Iranians can legitimately say: 'We have renounced weapons; we have cooperated with the IAEA; we are negotiating. So why impose sanctions on us, while North Korea can get away scot-free?'"
And there may be another message received in Tehran: "If you want to be alive, you have to be strong," says analyst Laylaz. "This is the main, first, and last lesson [for Iran] from North Korea."