Regardless of who wins, Khamenei remains Iran's ultimate decision-maker in matters of foreign and nuclear policy.
With economic misery palpable at home, Iran's rulers can not risk starting the talks from scratch after the election, as the ruling clerics are aware their political fortunes rely on tackling worsening economic hardship.
He then urged Iranian's almost 60 million eligible voters to follow suit, saying: "The sooner you perform this task and duty, the better".
If elected, Raisi would be the first serving Iranian president sanctioned by the U.S. government even before entering office over his involvement in the mass execution of political prisoners in 1988, as well as his time as the head of Iran's internationally criticized judiciary - one of the world's top executioners.
Voters queue at a polling station during the presidential elections in Tehran, Iran, June 18, 2021. Speculation already has begun that Raisi might be a contender for the position, along with Khamenei's son, Mojtaba.
Ultimate political power in Iran, since its 1979 revolution toppled the USA -backed monarchy, rests with the supreme leader.
The incumbent president is not running, as Iran has a two-term limit for the presidency.
The disqualifications affected reformists and those backing Rouhani, whose administration both reached the 2015 nuclear deal with world powers and saw it disintegrate three years later with then-President Donald Trump's unilateral withdrawal of America from the accord.
While Iran has insisted its nuclear program is for peaceful purposes only, Trump accused it of secretly seeking the bomb and of destabilizing the wider Middle East through armed proxy groups.
As old and new USA sanctions hit Iran, trade dried up and foreign companies bolted. The economy nosedived and spiraling prices fueled repeated bouts of social unrest, which were put down by security forces.
Iran's ultraconservative camp - which deeply distrusts the United States, labelled the "Great Satan" or the "Global Arrogance" in the Islamic republic - attacked Rouhani over the failing deal. The stakes are high: the victor of this election will lead Iran through a pandemic, intense economic sanctions, runaway inflation, and the ongoing negotiations to restore the nuclear deal.
Out of an initial field of nearly 600 hopefuls for the presidency, only seven - all men - were approved to run by the Guardian Council, a body of 12 clerics and jurists.
Raisi, whose main rival in the vote is moderate former Central Bank governor Abdolnasser Hemmati, was appointed by Khamenei to the high-profile job of judiciary chief in 2019.
Tehran blacksmith Abolfazl told AFP of his disappointment as a patriot who took part in the 1979 revolution. "I have no candidate here".
Polls close at midnight (1930 GMT), and possibly two hours later, with results expected around noon Saturday.
Iranian state-approved pollsters had predicted before the election that the turnout percentage could end up in the low 40s, which would mark a record low for a presidential election since Iran's 1979 Islamic Revolution, in which its ruling Shiite clerics seized power from a collapsing monarchy. The previous low turnout was 50% in 1993. If no clear victor emerges, a runoff will be held a week later.