Iranians are voting an a presidential election, in which Hassan Rouhani is seeking a second term.
Mr Rouhani, 68, a moderate cleric who negotiated a landmark nuclear deal with world powers in 2015, is standing against three other candidates.
His main challenger is seen as Ebrahim Raisi, 56, a hardline cleric and former prosecutor who is close to Supreme Leader Ayatollah Ali Khamenei.
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.
He cast his ballot just minutes after polls opened at 8:00 local time (03:30 GMT).
Image copyrightAFP / IRANIAN SUPREME LEADER’S WEBSITE
Image caption
Supreme Leader Ayatollah Ali Khamenei casts his vote
“Everyone should vote in this important election,” he said, urging citizens to get the polls early.
Mr Rouhani voted about an hour later.
Who are the candidates?
Instagram election sees rivals battle on social media
Five things to know
More than 54 million people are eligible to vote in Friday’s election.
The interior ministry says that 63,500 polling stations are being used. They are due to close at 18:00 (13:30 GMT) but in previous elections voting has been extended by several hours because of high turnout.
Early election results are expected on Saturday.
Image copyrightAFP
Image caption
The four remaining candidates are (clockwise from top left) Hassan Rouhani, Ebrahim Raisi, Mostafa Mirsalim and Mostafa Hashemitaba
Six candidates were approved by the Guardian Council, an influential clerical body controlled by conservatives, but two of them dropped out earlier this week.
The first was Tehran’s hardline mayor, Mohammed Baqer Qalibaf, who pledged his support for Mr Raisi on Monday. He was followed on Tuesday by Vice-President Eshaq Jahangiri, a reformist, who pulled out to smooth the path for Mr Rouhani.
The two other candidates still in the race are Mostafa Hashemitaba, a reformist, and Mostafa Mirsalim, an ultra-conservative figure.