"The fate of the country is in the hands of people", he said. Its President, Vladimir Putin, sent a congratulatory telegram to Rouhani, the Kremlin said on its website.
Rouhani had won the last election on a platform of promoting a more open Iran on the global stage as well as more freedoms domestically. "We also knew very well that should Raisi win, he would bring the same people that were of the (hard line) principalist camp, which would drive the country backward". "We showed them that we still exist", said 37-year-old Mahnaz, a reformist.
Incumbent President Hassan Rouhani has won Iran's election over his hardliner rival Ebrahim Raisi, the country's Interior Minister says.
Ali Asghar Ahmadi, the head of the Election Committee of Iran's Interior Ministry, who announced the nearly final results, also said that Iranian Interior Minister Abdolreza Rahmani Fazli would announce the final results of the election at 2:00 p.m. Iran time (0930 GMT) on Saturday.
Election officials extended voting hours at least three times.
Country's Interior Minister Abdolreza Rahmani-Fazli announced on Saturday that Rouhani obtained 23,549,616 votes out the total 41,220,131, while his rival Ebrahim Raeisi, received 15,786,449 votes.
Iran's president oversees a vast state bureaucracy employing more than 2 million people, is charged with naming Cabinet members and other officials to key posts, and plays a significant role in shaping both domestic and foreign policy.
"I voted for Mr. Rouhani", said Mostafa, a voter in Tehran who spoke to CNN.
Rouhani's extensive backroom experience, cultivated as a protege to the late revolutionary power-broker Akbar Hashemi Rafsanjani, puts him in a strong position to negotiate with more conservative forces in the judiciary and security forces.
Russian engineers a year ago began expanding Iran's Bushehr nuclear power plant.
"Democracy in Iran is allowed to bloom only a few days every four years, while autocracy is evergreen".
The 68-year-old has come to embody more liberal and reform-minded Iranians' hopes for greater political freedom at home and better relations with the outside world.
Raisi, 56, had accused Rouhani of mismanaging the economy, travelling to poor areas and holding rallies where he promised more welfare benefits and jobs.
"This election boils down to a fundamental choice between two priorities", said Ali Vaez, a senior Iran analyst at the International Crisis Group.
"I voted for Rouhani to prevent Raisi's victory. And I am proud of my President".
Ayatollah Ali Khamenei casts his vote. The president has curbed inflation and resumed oil exports, but unemployment remains high and economic growth has slowed. But they were 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.
Born into a religious family in 1948 and rising to the middle ranks within the Shi'ite clergy, Rouhani was active in the revolution that overthrew the US-backed Shah in 1979.
The first was Tehran's hard-line mayor, Mohammed Baqer Qalibaf, who pledged his support for Raisi on Monday.