Pro-reform Mehdi Karroubi and incumbent President Mahmoud Ahmadinejad during the election battle
Voters went to the polls in Iran on 12 June to choose the a new president. It had been billed as a battle between the ruling conservative or "principle-ist" president and more moderate candidates, and it did not disappoint.
In past elections, the incumbent has always won a second term and this time appears to be no different.
Official results had President Mahmoud Ahmadinejad winning with a large majority but opposition candidates are challenging that result.
Official results, released by the Interior ministry, stated that Mahmoud Ahmadinejad had garnered 62.6% while his closest challenger, Mir Hossein Mousavi, received only 33.8%.
The two other candidates won a much smaller percentage of the vote. Mohsen Rezai gained 1.7% and Mehdi Karroubi just 0.9%.
The ministry put turnout at 85%.
The result was quickly endorsed by the Supreme Leader, Ayatollah Ali Khamenei. He praised the turnout and called for calm in the wake of protests by opposition supporters.
However, Mir Hossein Mousavi then sent a letter to the Guardian Council - Iran's powerful clerical group - calling for the election to be cancelled.
In his letter, which was posted on his website, Mr Mousavi claimed that he was the real winner. He said that fraud was widespread and a review of the election must be put in place.
He also met with the Supreme Leader to discuss the elections.
On Monday, state television quoted Ayatollah Khamenei as calling on the Guardian Council to look into Mousavi's charges.
How powerful is the president?
The president is the head of government and on paper the second-most powerful man in Iran after the Supreme Leader, but the complex Iranian power structure that mixes democracy with theocratic rule means that his powers are limited.
The Supreme Leader, for instance, controls the armed forces and key official appointments such as the head of state television and radio.
The president is responsible for implementing the constitution and the day to day running of domestic and foreign policy matters including the budget.
However, all legislation must be approved by the non-elected constitutional body, the Guardian Council, to ensure that it is compatible with the constitution and Islamic Law.
Who were the contenders?
1. Principle-ist candidates:
Mahmoud Ahmadinejad - Iran's president since 2005. The 53-year-old transport engineer was previously the mayor of Tehran.
He is a hard-liner both at home, where he does not favour the development or reform of political institutions and abroad, where he has maintained an anti-Western attitude and insisted on keeping uranium enrichment as a part of Tehran's nuclear programme.
Bolstered by high oil prices, the president spent heavily to consolidate his position among the urban disenfranchised and the rural population.
Mohsen Rezai - The 55-year-old former commander-in-chief of the Islamic Revolution Guards Corps is secretary of the Expediency Council, which arbitrates on differences between the Majlis (parliament) and the Guardian Council.
He was seen as a pragmatist and an ally of the powerful centrist politician Akbar Rafsanjani. Mr Rezai campaigned against President Ahmadinejad's management style and called for a coalition government made up of both principle-ists and reformists.
Mr Rezai, who holds a doctorate in economics, said he would improve Iran's economic situation by promoting privatization and work for an increase in foreign investment.
2. Pro-reform candidates:
Mir Hossein Mousavi - The 68-year-old former prime minister stayed out of politics for some years but is returned to stand on a "reformist and principle-ist" ticket.
He had the backing of several major reformist parties, but did not manage to attract the support of the main principle-ist groups.
He is believed to have wanted to play the role of a political conciliator and to revive the idea of social responsibility and ethics. In foreign affairs, he seemed to have been offering little change on major issues.
Mehdi Karroubi - The 72-year-old cleric was an MP for 16 years, and Majlis Speaker for two terms. He is currently the leader of the National Trust Party, and stood at the centre of the political spectrum with a pro-reform agenda.
He was seen as a political survivor who sought a soft and gradualist strategy of reforms. He offered a more tolerant political climate at home and a toned-down foreign policy.
Pre-election opinion polls
Ahead of the election, reliable public opinion polls were hard to come by and most surveys in the media were seen as biased or manipulated to support campaign objectives.
However, there was a general pattern that put either President Ahmadinejad or Mr Mousavi in the first two places, with Mr Karroubi and Mr Rezai as the runners up.
President Ahmadinejad was well positioned as the balance of political power was seen to be in his favour. The Supreme Leader appeared to support him, while all the main state institutions were controlled by his allies.
However, reformists believed a large turnout would play in their favour.
What were the issues?
The campaign rhetoric and opinion polls before the election suggested that the economy was the major concern for most Iranians. Global recession, falling oil prices, government overspending, high inflation and high unemployment were also serious worries.
The disposal of Iran's oil money was the subject of much debate, with Mr Karroubi pledging the distribution of an oil dividend of 70 dollars to every Iranian.
In the 2005 election, President Ahmadinejad used class consciousness successfully, translating it into a war against financial corruption and the very rich. The approach appealed to the urban poor and rural populations in 2005 and the president build on this during the 2009 campaign.
Civil liberties, in particular women's rights and freedom of the media, were overshadowed by economic issues, but remained on the agenda. They were considered a significant force in mobilising reformist activists and the middle class vote.
What part did political groups play?
Political groups are generally weak in Iran, but politics is becoming increasingly institutionalised with individual players losing influence.
These elections were a battle between the ruling right-wing principle-ist and the more moderate tendencies within the ruling establishment. The two groups had their own ideological divisions and a number of disparate groups supported them.
Secular political parties and groups outside the establishment are barely tolerated and were not allowed to participate formally in the political process.
Did the media play a role?
Television and radio are both state-run and their sympathies were with the principle-ists, but by law, they must broadcast all candidates' campaign speeches and give them equal time. The broadcasts proved influential in forming public opinion in the last weeks of campaigning.
The pro-reform newspapers and internet sites are highly influential and had some impact on the campaign.
Persian-language channels broadcasting from outside Iran also played a role in shaping public opinion. In previous elections they encouraged people not to vote so as not to give legitimacy to the regime.
How did the campaign go?
Iran has strict rules on how election campaigns should be run, for example, all campaign literature must be submitted to the Interior Ministry and the Guardian Council by the printers.
But in this campaign, the candidates complained of "distortions and insults" and "slander and lies" by opponents, prompting Ayatollah Khamenei to tell all of them to watch what they said about each other.
More worrying was the warning from the Guardian Council that "misconduct" might cause them to cancel the voting in some polling stations.
The voting system
The president is elected every four years by popular vote and may serve a maximum of two consecutive or three non-consecutive terms.
The election is won with an absolute majority. If none of the candidates achieves this in the first round, a second round takes place.
Only the two candidates who received the greatest number of votes in the first round go through to the second, where the candidate who receives the largest number of votes wins.
The results are usually announced within 24 hours, but the Guardian Council has up to 10 days to confirm the validity of the vote.
Who runs the election?
The Interior Ministry is responsible for holding the elections and the vote count, but the Guardian Council is responsible for supervising the election.
Both bodies have the right to post observers at polling stations and representatives of political groups and candidates are allowed to supervise.
Who can be a candidate?
The constitution provides that candidates must come from the ranks of religious and political personalities; have administrative abilities; be resourceful, of good standing, trustworthy and pious; and believe in the fundamental principles of the Islamic Republic.
The Guardian Council vets candidates and has the power to disqualify any it believes do not meet the constitutional requirements. There is a right of appeal against disqualification, but the process is secretive and difficult to influence.
In this election, 475 individuals registered as candidates but the Guardian Council disqualified all but four.
Most were unknown individuals, accused by the press of registering for the excitement, but the Guardian Council also barred a number of middle-ranking politicians. One of these, a reformist former MP Akbar Alami, wrote an open letter to Ayatollah Khamenei to protest against his disqualification.
"You urged the nation to vote for someone who understands the pain of the country and the people... When the [Guardian Council] under your command limits the choice of people to a small circle of those affiliated to and imposed by the council, and gives the option of choosing between bad and worse, how can people vote based on their own understanding?" he asked.
Who is able to vote?
Iranians who are 18 years old and over are allowed to vote resulting in an electorate of some 46.2 million people.
Young people constitute a large part of the electorate with about 50% of voters being under 30.
BBC Monitoringselects and translates news from radio, television, press, news agencies and the internet from 150 countries in more than 70 languages. It is based in Caversham, UK, and has several bureaux abroad.