(AP Photo/Vahid Salemi). Supporters of Iranian President Hassan Rouhani flash the victory sign from their auto outside a polling station for the presidential and municipal councils election, in Tehran, Iran, Friday, May 19, 2017.
The election is largely viewed as a referendum on the 68-year-old cleric's more moderate policies, which paved the way for the nuclear accord despite opposition from hard-liners.
During more than 10 hours, Iranians cast their votes at some 63,500 polling stations inside the country.
Rouhani secured a deal with the U.S. and other world powers in 2015 to end painful economic sanctions in exchange for rolling back Iran's nuclear fuel programme. Raisi ran a populist campaign, vowing to fight corruption and fix the economy while boosting welfare payments to the poor.
Trump has repeatedly threatened to rip up the deal.
A victory for Rouhani is seen as strengthening his domestic mandate to integrate Iran with the global economy. He was photographed arriving at the Interior Ministry in Tehran late Friday, but the nature of the claims was not immediately clear.
Throughout the day, independent observers described unprecedented lines swelling at voting stations across the capital, Tehran, especially in middle-class districts strongly in support of Rouhani. Analysts have suggested a high turnout will aid Rouhani in securing a second four-year term.
When he was swept to office four years ago with three times as many votes as his nearest challenger, Iranians held high hopes that he could fulfil his promises to reduce the country's isolation overseas and bring more freedoms at home.
The meeting in March between Putin and Rouhani, who have grown closer through their mutual support of Syrian president Bashar al-Assad, mostly focused on the countries' flourishing economic ties in the fields of energy and industry.
"We had a bet among friends, and I said Raisi would win and I think that encouraged a few of my friends who might not have voted to come out and vote".
One Rouhani supporter warmly welcomed the news, but said she expected him to provide greater social and economic freedoms, pledges he made when first elected in a landslide in 2013 by Iranians tired of economic decline and clampdowns on dissent.
The Revolutionary Guards (IRGC), the country's most powerful security force, are unlikely to forget his attacks, which played to widespread frustration with a state that controls how Iranians speak, gather and dress. Joblessness remains high - although it fell during Rouhani's first term - and growth is middling.
All candidates for elected office must be vetted, a process that excludes anyone calling for radical change, along with most reformists. The most powerful leader in the system is the supreme leader, who is chose by a clerical panel and has the final say in all the state matters.
"The business community, especially the private sector, is for Rouhani's re-election for the simple reason that we need continuity and consistency", said Cyrus Razzaghi, president of Ara Enterprise, a Tehran-based consultancy.
During the previous presidential election in June 2013, Rouhani had emerged victorious by winning 50.7 percent of a total of over 36 million votes.
Rouhani has been unable to secure the release of reformist leaders from house arrest, and media are barred from publishing the words or images of his reformist predecessor Khatami.