Looking at Libya, Iraq, and North Korea, Iran's leaders have decided that their regime will have a better chance of survival with nuclear weapons than without.
Libyan and Korean examples guide Iran's nuclear plan
Two years of tumult, revolt and change in the Arab world have emboldened Iranian leaders, intensifying their determination to gain access to nuclear capabilities.
This explains why Iran has resisted sanctions, failed to take recent western-led talks seriously and even threatened to pull out of the 1970 Treaty on the Non-Proliferation of Nuclear Weapons, known as NPT.
What Iranian leaders have learnt from the Arab revolts - and this point has had little media attention - is that obtaining nuclear weapons is imperative for the regime's survival. As Iran's leaders see it, a state without nuclear deterrence capabilities is notably more vulnerable to foreign intervention and internal uprisings.
When Muammar Qaddafi of Libya was overthrown by extensive Nato air raids and western support for rebels inside the country, the US and its allies expected his fate to be a lesson for Iran.
They believed that Qaddafi's overthrow would leave a lasting impression on the Iranian leaders, showing them that their own government, with its internal repression and authoritarian structure, was bound to follow that of the Libyan leader.
But Iran's leaders drew a different lesson. Ayatollah Ali Khamenei, Iran's supreme leader, pointed out after Qaddafi's fall that the deposed dictator had earlier "wrapped up all his nuclear facilities, packed them on a ship and delivered them to the West and said, 'Take them!'".
In other words, Iran's nuclear ambition, which is driven by political insecurity, left Mr Khamenei even more convinced that if he were to scrap Iran's nuclear programme, as Qaddafi scrapped his in 2003 and 2004, he would only invite the same fate.
Watching Qaddafi's 42-year rule crumble was an important and unforgettable lesson for the Iranian government.
On the other hand, Iran's rulers see recent developments in Kim Jong-un's North Korea as an example of how a nuclear programme can bring political success.
If the West is really worried about nuclear weapons, this theory runs, then it should focus on North Korea. Instead, political, economic and strategic pressure has been aimed primarily at Iran, which has yet to achieve nuclear weapons.
To Iranian eyes, the North Koreans have been able to defy the international community, even conduct nuclear tests, without concern about foreign intervention, simply because Pyongyang is already a nuclear-weapons state.
From Tehran's perspective, if Iran is going to undergo sanctions because of the state's internal repression, human rights abuses and political authoritarianism, along with its nuclear enrichment plans, then it would be more efficient and strategic to face these sanctions with the bomb than without it. It is better to be North Korea than to be Iraq or Libya.
Another crucial lesson the Iranian leaders have learnt, and which has emboldened them to barely bother with continuing but desultory nuclear negotiations, is that the US and its western allies have shown themselves to be incapable of intervening in a country aligned with Russia and China, even if that country is a militarily and economically weak one.
The international community's paralysis in the case of Syria's civil war has projected a clear picture for the rulers of Iran; as long as a government has the support of China and Russia, then the West and Arab states will not be capable of leading or mounting a military intervention.
It is worth noting that Iran is a much more significant economic, political and strategic partner for China and Russia than Syria has ever been. Iran is much more significant than Syria on the scales of military power, population size and technological advancement.
Currently, China receives about 15 per cent of its oil supply from Iran. After Japanese interests, Chinese companies are the largest purchasers of Iranian crude oil, and have begun to intensify their investments in Iran. The China National Petroleum Corporation has signed contracts, some worth billions of dollars, to develop oil and natural gasfields in Iran.
These Chinese investments have helped Iran to withstand the losses inflicted by continuing western sanctions.
Meanwhile, influential Russian organisations, such as Atomstroy, an exporter of atomic-energy equipment, now send a high proportion of their exports to Iran.
Iranian leaders are confident that China and Russia would stand by them in the event of any country deciding to intervene in Iran militarily.
Support from these two world powers, with all their economic, military, geopolitical and veto influence, are likely to deter the international community from any military adventure against Iran, the theory goes.
That is a large part of what has led Iranian leaders to threaten to pull out of the NPT as a reaction to western demands, pressures and sanctions.
Al Alam state television has reported that Allaedin Boroujerdi, head of Iran's parliament's security and foreign policy committee, said this last week: "It's not acceptable that Iran respects NPT but the US and the West ignore NPT's Article 6 [about the reduction of weapon stockpiles] and Article 4 [about the right to enrich uranium] …
"There is no reason for Iran to remain a NPT member under such circumstances," he went on.
In short, progress on its nuclear programme, and powerful friends, are in Tehran's view giving Iran all the support it needs.
Iranian-Syrian scholar Majid Rafizadeh is president of the International American Council on the Middle East