The two frontrunners are incumbent president and moderate Hassan Rouhani, and Ebrahim Raisi, a hard-line conservative who favors isolationism.
Ali Asghar Ahmad, the head of the election committee, had told Iranian state TV in the morning that almost 26 million votes of the total 40 million votes cast on Friday have been counted, with Rouhani getting 14.6 million votes and his closest rival, Ebrahim Raisi, obtaining 10.1 million votes.
"The election boils down to whether Rouhani is allowed a second term to finish what he began, or potentially Iran taking a different turn and standing up to the outside world", Al Jazeera's Jonah Hull, reporting from Tehran, said. He cited no evidence. There were reports of people being turned away as polling stations closed their doors at midnight.
Momani says "there is more potential for conflicts" between the USA and Iran if Raisi becomes the next president.
Raisi, a former judicial official and prosecutor, sought to drum up support among poorer voters, dissatisfied with the government's failure to revitalize the economy despite the partial lifting of western sanctions.
The government said over 40 million people voted, out of 56 million who were eligible.
Many voters at the NY polling booth had to take the day off work to cast their ballots.
Rouhani, who had received 18.6m votes in 2013, is projected to receive well above 20m this time.
In many cities across the country, turnout was more than 70% but the overall tally has not yet been announced.
However, his supporters will be aware that even if re-elected, what Rouhani can achieve may be limited by the authority wielded by Iran's Supreme Leader Khamenei, and by institutions such as the Revolutionary Guards.
Six candidates had been vetted and approved by the Guardian Council to run in the election.
By securing more than 50 percent of the votes, Rouhani is expected to be declared the outright victor.
For many in Iran, especially in affluent areas of the capital, Tehran, Rouhani has provided a glimpse of what many have long desired - engagement with the outside world, without the types of banking and visa restrictions, as well as economic sanctions - that left them feeling so isolated.
In the 1980s, he helped sentence thousands of political prisoners to death. "Ya Hossein, Mir Hossein" was a ubiquitous slogan chanted by Rouhani fans in nearly every place he campaigned in the three weeks before the vote.
But he was a relative unknown when he entered the race earlier this year, having occupied powerful but backroom positions in the judiciary through most of his career. He is subordinate to the country's supreme leader, who is chosen by a clerical panel and has the ultimate say over all matters of state.
"I cast my vote already - I voted for Raisi because he is a follower of Imam Khamenei".
Raisi has said he will stick by the nuclear deal but pointed to the continued economic slump as proof that Rouhani's diplomatic efforts have failed.
The two other candidates, Mostafa Aqa-Mirsalim and Mostafa Hashemitaba, are trailing behind with 297,276 and 139,331 votes, respectively.