Final results show incumbent president emphatically beating rival Ebrahim Raisi to extend his time in office.
Iran's reformist President Hassan Rouhani has decisively won the country's presidential election, according to official results, fending off a challenge by principlist rival Ebrahim Raisi.
With all of votes in Friday's poll counted, Rouhani was re-elected with 57 percent, Interior Minister Abdolreza Rahmanifazli said on Saturday.
"Of some 41.2 million total votes cast, Rouhani got 23.5 ... and won the election," Rahmanifazli said in remarks carried live by state TV.
Raisi, Rouhani's closest rival, got 15.8 million votes, he added.
A big turnout on Friday led to the vote being extended by several hours to deal with long queues.
Rouhani swept into office four years ago on a promise to reduce Iran's international isolation.
Friday's poll was the first since he negotiated a historic deal with world powers in 2015 to curb the country's nuclear programme in exchange for sanctions relief.
In the campaign trail, Rouhani sought to frame the vote as a choice between greater civil liberties and "extremism", criticising the continued arrest of reformist leaders and activists.
Raisi, for his part, accused Rouhani of mismanaging the economy and positioned himself as a defender of the poor, calling for a much tougher line with the West.
Political commentator Mostafa Khoshcheshm said that in contrast to the 2013 election campaign, when Rouhani spoke about the removal of sanctions and the improvement of the economy, this time his message was different.
"He resorted to other campaign slogans, like [calling for] social and political freedom, and he pushed the boundaries in order to gather public support, especially in large cities," Khoshcheshm told Al Jazeera.
"If he has secured this result, it's because of the large cities and the middle-class society living there - they have voted for him and made him a president and they expect him to do his promises."
Rouhani's re-election is likely to safeguard the 2015 agreement, under which most international sanctions have been lifted in return for Iran curbing its nuclear programme.
Rouhani has vowed to work towards removing the remaining non-nuclear sanctions, but critics argue that will be hard with Donald Trump as US president. Trump has repeatedly described it as "one of the worst deals ever signed", although his administration re-authorised waivers from sanctions this week.
Rouhani is also expected to face the same restrictions that prevented him from delivering substantial social change in his first term.
Supreme Leader Ayatollah Ali Khamenei has veto power over all policies and ultimate control of the security forces, while Rouhani has been unable to secure the release of reformist leaders from house arrest.
Al Jazeera's Jonah Hull, reporting from Iran's capital, Tehran, said that Rouhani, during an "increasingly acrimonious election campaign, alienated a lot of Iran's significant state institutions who may be in no mood to cooperate with him going forward".
Slow pace of change
While the nuclear deal was at the forefront of the election, the campaign was dominated by the issues of poverty and unemployment.
Rouhani has brought inflation down from around 40 percent when he took over in 2013, but prices are still rising by more than seven percent a year.0Oil sales have rebounded since the nuclear deal took effect in January 2016, but growth in the rest of the economy has been limited, leaving unemployment at 12.5 percent overall - close to 30 percent for the young - and many more are underemployed or struggling to get by.
"Rouhani now gets his second term, and will be able to continue the work that he started in his first four-year term trying to reform Iran," Hull said.
"And moving on, crucially, from the nuclear deal to try and bring much more economic progress to satisfy the people who have found themselves extremely disappointed with the very slow pace of change since that agreement was signed."