There has been a perverse symmetry for more than half a century in the behaviour of Iran and the actions of most of its Arab neighbours.

The Arab world was electrified by the rhetoric of Egypt’s late president Nasser in the 1950s and 1960s. Iran, in contrast, settled into a pro-western trajectory under the Shah. As the radical wave dissolved in the Arab world in the late 1970s, Iran exploded into revolution.

This may be a coincidence. But if it is not, the Gulf in 2009 may be about to enter a new phase in which Iran could be seen once again as a stabilising factor in the Middle East.

The Islamic Republic is preparing for the presidential election on 12 June. More than 20 people have declared their candidacy, including Mohammad Khatami. He was president in 1997-2005 and is considered the most credible moderate contender. It is assumed President Ahmadinejad will seek a second four-year term.

Predicting how Iranians will vote this summer is hazardous. But after four years under Ahmadinejad, the appeal of moderation may be widening.

Several factors are at work. The failings of the Iranian economy are exaggerated. The country is far from broke. But government income and the balance of payments are being ravaged by the fall in oil prices and world oil demand. This is no time for Iran to provoke its neighbours or the West.

The second factor is the growing confidence in the durability of the institutions of government created since the 1979 revolution. For most Iranians, the Islamic republic is the only system they have known. It may be defective, but no better alternative is obviously at hand.

Third, the paranoia which has gripped Iran’s leaders is beginning to decline. They were rightly convinced that the US was striving to reverse the revolution and install a pliant regime. Their unease intensified following the invasion and occupation of Iraq by a US-led coalition in 2003. After the easy defeat of Saddam Hussein, taking Iran seemed the next step. Regime change was espoused at the highest levels of US politics.

What Washington got instead was Ahmadinejad. His rhetoric on foreign affairs, as crude as it often sounded, struck a chord with the Iranian masses. His defiance of the US, as foolhardy as it seemed to outsiders, was a deterrent that worked. The world was horrified when Ahmadinejad ordered a resumption of Iran’s nuclear programme. In the end, however, it was the US that flinched. An attack on Iran is now almost certainly off the agenda.

President Obama has signalled that the US is interested in serious talks with Tehran. This is an opportunity that will surely be irresistible. Ahmadinejad and his rhetoric have served their purpose and are now probably counterproductive. For Iranians wanting to consolidate the revolution at home in challenging economic times, a moderate president makes sense.

The final factor is that Iran may have managed at last to export its ideas to the Arab world. Iraq’s Shiite majority failed to follow Iran’s lead in 1979 and fought for Saddam Hussein in the 1980-89 Gulf war. Tehran’s calls for Muslim Arabs to overthrow their governments fell on deaf years. The divide between Shiites and Sunnis was unbridgeable, or so it seemed, until Israel’s assault on Gaza.

Hamas, a Sunni Muslim political party inspired by Iran’s revolutionary movement, has captured the imagination of the Arab world by surviving the Israeli assault. Wounded but unbroken, it constitutes a new blueprint for those wishing to defy the West and challenge the Arab status quo. The Iranian bacillus of politically engaged Islamic radicalism, successfully resisted for a generation, has finally been injected into the politics of the wider Middle East. All Iran needs to do now is wait and see what happens.

Arab regimes are already responding to a new trend in regional affairs. In 1996, former Israeli prime minister Shimon Peres was invited to Doha. Qatar established links with Israel and announced plans to supply the Jewish state with gas. In January 2009, Doha broke with Israel and hosted a summit that was attended by Hamas leader Khaled Mishaal.

Throughout the region, governments are begin to recognise that tumbling growth, rising unemployment and comprehensive disillusionment with the West could feed the Hamasisation of their societies, particularly the young. And no part of the Arab world is immune.