Polling has ended in Iran's presidential elections after being extended three times and by five hours.Long queues had formed outside polling stations throughout the country after an unexpectedly high turnout.
Counting begins shortly and results may come as early as Saturday afternoon.
Supporters of President Hassan Rouhani came out in big numbers after signs that the hard line backers of his main challenger, Ebrahim Raissi, had mobilised all their forces to vote.
Election officials said the extensions to voting hours were due to "requests" and the "enthusiastic participation of people".
Ballot papers also ran out for Iranians voting in Istanbul in neighbouring Turkey, and attempts were made to fly in more from Tehran.
President Hassan Rouhani is seeking a second term, standing against three other candidates.
If no-one wins more than 50% of votes cast, a run-off will be held next week.
Every incumbent president has been re-elected in Iran since 1985, when Ayatollah Khamenei himself won a second term.