Congratulations poured in for Iranian ultraconservative cleric Ebrahim Raisi on Saturday for winning presidential elections even before official results were announced.

Iran's outgoing moderate President Hassan Rouhani said his successor had been elected in the previous day's vote, without naming the widely expected winner, Raisi.

"I congratulate the people on their choice," said Rouhani. "My official congratulations will come later, but we know who got enough votes in this election and who is elected today by the people."

The other two ultraconservative candidates -- Mohsen Rezai and Amirhossein Ghazizadeh-Hashemi -- explicitly congratulated Raisi.

"I congratulate ... Raisi, elected by the nation," Ghazizadeh-Hashemi said, quoted by Iranian media.

And Rezai tweeted that he hoped Raisi could build "a strong and popular government to solve the country's problems".

The only reformist in the race, former central bank governor Abdolnasser Hemmati, also tweeted his congratulations to Raisi.

Raisi, 60, takes over from Rouhani in August as Iran seeks to salvage its tattered nuclear deal with major powers and free itself from punishing US sanctions that have driven a sharp economic downturn.

Raisi, the head of the judiciary whose black turban signifies direct descent from Islam's Prophet Mohammed, is seen as close to the 81-year-old supreme leader, Ayatollah Ali Khamenei, who has ultimate political power in Iran.

Friday's voting was extended by two hours past the original midnight deadline amid fears of a low turnout of 50 percent or less.

Raisi won more than 17.8 million votes out of 28.6 million ballots counted, far ahead of the second-placed candidate Mohsen Rezai, who won 3.3 million votes, election office chairman Jamal Orf said on state television after Friday's vote.

Iran has more than 59 million eligible voters but no turnout figures have yet been released.

Many voters chose to stay away after the field of some 600 hopefuls including 40 women had been winnowed down to seven candidates, all men, excluding an ex-president and a former parliament speaker.