He won a landslide victory in the 1997 presidential election. His campaign pledges included greater freedom of expression, as well as measures to tackle unemployment and boost privatisation.

His victory was attributed largely to support from young people and women, impressed by his vision of "religious democracy".

President Khatami's first term ushered in some liberalisation, exemplified by a renaissance of the print media and improved relations with states inside and outside the region.

In January 1998 he held out the prospect of rapprochement with the US, by addressing the American nation on CNN to stress that Iran had "no hostility" towards them.

In September 1998, the president addressed the UN General Assembly to propose that it declare 2001 the year of "Dialogue among Civilisations". The proposal, aimed at fostering global tolerance, was duly adopted.

'Islamic democracy'

Yet his attempt to implement "Islamic democracy" at home found itself blocked by the country's conservative institutions. The initial blossoming of the media was followed by newspaper closures and the arrest of journalists.

Our students have the right to stage their protests and, fortunately, they have demonstrated their maturity

Mohammad Khatami

Despite these setbacks and economic woes compounded by the fall in the oil price, Mr Khatami went on to win a second term in 2001. Though the turnout was lower than in 1997, his percentage of the vote rose.

Frustrated by the obstacles to his reforms, he submitted a bill aimed at boosting presidential power, and another curbing the role of the Guardian Council, which has to approve all legislation.

The bills were overwhelmingly approved by parliament in April 2003 but rejected by the Council as unconstitutional in May.

In May 2003 an open letter signed by 153 deputies was read out in parliament, urging conservatives to give way to reforms. Otherwise, the letter says, Iran could face the same fate as Saddam Hussein's Iraq.

When students, once the president's natural constituency, took to the streets in June 2003 over the slow pace of reform, they called for his resignation along with that of hardliners.

In televised remarks, he defended the students' action: "Our students have the right to stage their protests and, fortunately, they have demonstrated their maturity in so doing."

But he also reacted to US President George W Bush's comment that the protests showed Iranians wanted freedom with a warning: "We will not allow any foreigner to interfere in our destiny."

Moderate voice

In 2005, he left office, having served the maximum two consecutive terms allowed by the Iranian constitution.

He was succeeded by an ultra-conservative, Mahmoud Ahmadinejad, whose questioning of the Holocaust has consistently caused controversy in the West.

In 2006, Mr Khatami told the BBC that US attempts to impose Western-style democracy in the Middle East were a "joke".

He added that he was committed to fighting extremism around the world.

While he has defended Iran's pursuit of civilian nuclear energy, he has conceded that the outside world does have legitimate worries which need assuaging.

The moderate tone of his comments contrasted starkly with the strident talk of President Ahmadinejad.

This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.