Rouhani's main challenger is Ebrahim Raisi, a hardline cleric and former prosecutor who is close to Supreme Leader Ayatollah Ali Khamenei.
Out of some 40 million votes cast, he received more than half of those already counted, with some areas still to declare, officials said on TV. If no candidate wins more than 50 percent of the vote, the top two, presumably Rouhani and Raisi, would face each other a second time in a run-off in a week.
Iranians continued voting into the evening on Friday in the country's first presidential election since its nuclear deal with world powers, as incumbent Hassan Rouhani looked to fend off a staunch challenge from a hard-line opponent.
But for others, Rouhani is the best candidate to tackle the country's key issues.
Iran has 56 million eligible voters, and given voter turnout for the 2013 election was almost 73 percent, high turnout is again expected.
Iran's Supreme leader, Ayatollah Ali Khamenei, cast his vote early and urged Iranians to turn out in large numbers.
"I believe that the presidential election is very important". But they are anxious to keep out Raisi, who they see as representing the security state at its most fearsome: in the 1980s he was one of four judges who sentenced thousands of political prisoners to death.
As his campaign for re-election got under way, many reformist voters said they were disillusioned, an apathy Rouhani's allies saw as the biggest threat to his re-election.
At least 100 people were arrested in Iran's Tehran Province on May 19 for election-related offences, Gholam Hossein Esmaili, head of Tehran Province Justice Department, said. Rouhani, 68, is a staunch supporter of broader global engagement and liberal economic reforms.
In working-class southern Tehran, a bastion of conservatives, lines were shorter but many voters said they had cast their ballots for Rouhani.
Conservative cleric Raisi is a hardliner who advocates protecting the conservative values of the Iranian revolution.
But Rouhani won't necessarily benefit.
Iranians families casted their votes at Iranian Consulate from 8am to 6pm.
In a tight contest, a traditionally high turnout among conservatives could be enough to give Raisi victory.
Although announcing that he will uphold the nuclear pact should he win, Raeisi has pointed to the economic difficulties as proof that Rouhani's diplomatic efforts have failed and has advocated an "inward-looking" policy for reviving the sluggish economy.
Ahmadi says the Interior Ministry hopes to have final results later Saturday.
His four years in office is defined by the landmark July 2015 nuclear deal with the six world powers.
"The next president should not be someone who makes the enemies happy when he is elected", said Kermani, who is an adviser to Khamenei. Since the deal went into effect, Iran has doubled its oil exports and inked multi-billion-dollar aircraft deals with Boeing and Airbus.
Raisi ran a populist campaign, vowing to fight corruption and fix the economy while boosting welfare payments to the poor. Joblessness remains high - although it fell during Rouhani's first term - and growth is middling. It is the upper house of the Iranian Parliament and has twelve members, all of whom are men.
"This Friday our nation will announce whether it wants to continue the path of peacefulness or path of tension", Rouhani said on Saturday.
- Mixture of old and new faces in Macron's first government
- Alexis Sanchez will leave Arsenal if one thing happens
- Predators forward Ryan Johansen has thigh injury, out for playoffs
- Kyle Lowry doubtful for Game 4 against Cavaliers
- Frenchman claims cure for WannaCry-infected computers
- Cyber Attack Hits China Government, Schools, but Spread Slows
- Google I/O 2017: All Exciting Things You Need To Know
- Pogba to return for Manchester United on Sunday
- Cyber should be wake-up call for govts
- Classic Empire: Preakness Stakes Contenders