Polls opened in Iran on Friday with voters set to give their verdict on President Hassan Rouhani's policy of opening up to the world and efforts to rebuild the stagnant economy.
He faces stiff competition from hardline cleric Ebrahim Raisi, 56, who has positioned himself as a defender of the poor and called for a much tougher line with the West.
Supreme leader Ayatollah Ali Khamenei cast his ballot just minutes after polls opened at 8:00 am (0330 GMT).
"The destiny of the country is in the hand of Iranians," he told reporters as he voted in his compound in Tehran.
Long lines had already formed at polling stations around the country.
Rouhani, a 68-year-old moderate cleric, has sought to frame the election as a choice between greater civil liberties and "extremism".
He has pushed the boundaries over the past fortnight, criticising the continued arrest of reformist leaders and activists, and calling on security agencies not to interfere in the vote.
Raisi says he will stick by the 2015 nuclear deal with world powers, that saw curbs to Iran's atomic programme in exchange for sanctions relief, but he points to the continued economic slump as proof that Rouhani's diplomatic efforts have failed.
"Instead of using the capable hands of our youths to resolve problems, they are putting our economy in the hands of foreigners," Raisi said at a final rally in the holy city of Mashhad on Wednesday.
Rouhani responded by calling on voters to keep hardliners away from Iran's delicate diplomatic levers.
"One wrong decision by the president can mean war and a correct decision can mean peace," he said at his own Mashhad rally.
The election comes at a tense moment in US-Iran relations.
Rouhani gained a reprieve on Wednesday when the administration of US President Donald Trump agreed to continue waiving nuclear-related sanctions, keeping the deal on track for now.
But Trump has launched a 90-day review of the accord that could see it abandoned, and is visiting Iran's bitter regional rival Saudi Arabia this weekend.
"For me, Mr Rouhani's dialogue with the world and moderation in society are very important," said Zahra, a 32- year-old PhD student in food science.
Under former hardline president Mahmoud Ahmadinejad, "the sanctions really hurt us. It was hard to get lab equipment and very difficult to get visas to study abroad.