Polls have closed in Iran's unprecedented second-round presidential election, which offered voters two distinctly different future visions.
The election has generated huge public interest across Iran
Former president and moderate Akbar Hashemi Rafsanjani stood against ultra-conservative Mahmoud Ahmadinejad.
A large turnout meant officials were forced to repeatedly extend the opening hours of polling stations.
Votes will be counted by hand and the process is expected to continue late into the night.
The BBC's Frances Harrison in Tehran says that the high number of voters reflects a sense that this election could mark a turning point in Iran.
Mr Rafsanjani is a cautious reformer seeking a rapprochement with the West while Tehran mayor Mr Ahmadinejad is a hardline conservative.
The previous round was tarnished by allegations of fraud and intimidation, with three of the candidates alleging an orchestrated plot to influence the outcome in favour of the hardliners' candidate.
Earlier, the interior ministry said it had received reports of vote fraud from six polling stations in the capital.
Polling finally closed at 1830 GMT after being extended several times throughout the night to allow Iranians waiting outside stations to cast their ballots.
An interior ministry spokesman said on Friday that he had received many reports of a systematic build-up of people inside and outside polling stations who had nothing to do with administering the process.
Mr Ahmadinejad's strong showing a week ago surprised many Iranians, when he beat five other candidates to go through to Iran's first second-round run-off.
Supreme leader Ayatollah Ali Khamenei cast his ballot soon after polls opened at 0900 (0430 GMT).
"The more people who participate in the election, the better it will be for the next president and for protecting Iran, and achieving our goals," he said.
Opinion polls suggest the two candidates are neck and neck.
As Mr Rafsanjani voted, he told reporters: "It's a very close competition, but according to the information I have, I am ahead of the other candidate."
Mr Ahmadinejad said: "Today is the beginning of a new political era for the Iranian nation."
The differences between the two candidates have offered a stark choice to Iran's 47 million voters, half of whom are aged under 25.
Mr Rafsanjani is a former president who has campaigned for a new term in office promising social reforms and closer relations with the West.
Mr Ahmadinejad, by contrast, is a former military figure who has pledged to redistribute wealth and step up efforts to counter Western "decadence" within Iran's Islamic society.
Our correspondent says the choice between the two has divided the country from top to bottom along ideological and class lines.
While Mr Ahmadinejad's Islamic orthodoxy has concerned many, others have attacked Mr Rafsanjani's alleged wealth, branding him "a new Shah".
"I will vote for Ahmadinejad because he wants to cut off the hands of those who are stealing the country's national wealth. He wants to fight poverty, fraud and discrimination," said Rahmatollah Izadpanah, 41, queuing to vote in south Tehran.
But Reza Khatibi, 47, a book store owner, said: "Rafsanjani can manage the important issues of Iran... in a moderate way. If he's not elected, I will leave this country. It will be so dangerous."