Negotiating with Jack Straw, then Britain's Foreign Secretary, and other European diplomats, Rowhani agreed to a temporary suspension of Iran's enrichment activities - after being given the go-ahead by Ayatollah Khamenei. Straw has paid tribute to Rowhani's negotiating skill as "extremely professional".
He resigned soon after President Mahmoud Ahmadinejad took office in 2005, after hardliners attacked his negotiating stance as too conciliatory.
After being approved as a candidate for this year's election by the powerful guardian council, Rowhani attracted the support of reform-minded voters with his call for an end to the repressive "security atmosphere" and a pledge to allow greater personal freedom. He has vowed to seek an improvement in Iran's relations with the West.
His election rallies are reported to have attracted mass turnouts, particularly after endorsements from Khatami and Rafsanjani, who have more established credentials as representatives of Iran's liberal-leaning middle classes.
Some of his campaign workers were detained after a rally two weeks at which supporters were heard chanting slogans in support of Mir Hossein Mousavi and Mehdi Karroubi, reformist candidates in the fraud-tainted 2009 elections, who are now under house arrest.
Rowhani's stances
Nuclear issue: "We will stand firm to get our nuclear rights recognised as we do for sanctions to be lifted. We need nuclear energy for the nation's progress and my Government will ensure this right is recognised at the lowest cost."
Iran-US relations: "The US is a world reality which no one can ignore. It is a superpower and the world's first economy, military and scientific power. We will first convert hostile relations to a one-on-one relationship but with tensions, and in the second phase we will gradually decrease tensions ..." "
The economy: "I have come forward to save Iran's economy and forge a constructive interaction with the world through a Government of wisdom and hope."
Political affiliation: "Personally, I believe that the majority of the people seek moderation and rationality. In all of my political career I have had very good relations with the moderates of both political factions - reformists and conservatives. I believe the majority of our society is comprised of moderates."
Women: "Discrimination against women will not be tolerated."
- AFP
Does the election matter?
Yes, but Iran's President does not set major policies such as the nuclear programme, relations with the West, or military projects. This falls under the ruling clerics led by Ayatollah Ali Khamenei. The President oversees vital sectors such as the economy. Still, Iran's voters have taken the opportunity to tell the theocracy in Tehran that they have had enough of eight years of antagonising the West under the outgoing President, Mahmoud Ahmadinejad. The President-elect, Hassan Rowhani, has called for a different approach to the West, especially over Iran's controversial nuclear programme.
Will it affect Iran's nuclear programme?
It won't have a direct effect. Indirectly, though, the poll can have some influence. One theory is that it could end the political bickering of the Ahmadinejad era, leaving the clerics more comfortable in making deals with the West. But a second is that a seamless front between the ruling clerics and the new President could embolden Iran to take an even more hardline approach.
Who voted?
Iran has more than 50 million eligible voters in a population of about 76 million. About a third are under 30 - born after the 1979 Islamic Revolution. The minimum voting age is 18. More than 36 million votes were cast. Rowhani won 50.7 per cent - more than 18.6 million of them. The turnout was 72.7 per cent.
The top power structure:
Supreme Leader Ayatollah Ali Khamenei
Wields control over every major decision either directly or through a network of hand-picked loyalists and institutions.
Guardian Council
Group of 12 experts in Islamic law who approve all candidates for high elected office and can veto parliamentary bills considered to be in violation of Iran's Islamic constitution.
President
The President helps direct economic policies, domestic social programmes, education plans and some public works. The President also has some voice in the level of freedoms such as media and political openness but can be over-ruled by the clerics using the judiciary or Revolutionary Guard. The President represents Iran in many high-profile international forums, but the clerics set all-important foreign and defence policies.
- AP