Rouhani now has the difficult task of making good on his promises of putting the economy back on track and relieve Iran from the remaining international sanctions.
The two other candidates Mostapha Aqa Mirsalim and Mostafa Hashemitaba both won around 1 percent of the votes.
Voting took place until deep into the night. Initially polling stations were to close at 20:00, but this was extended twice.
In the end, the doors closed at midnight, but many people who managed to get inside still took long hours to cast their ballot.
Reactions in Tehran’s streets were in stark contrast to the festive atmosphere of just two days ago, when people were shouting slogans and singing until deep in the night.
This morning - Saturday - the town is shrouded in an anti-climactic silence and people go about their business.
Rouhani’s victory does not come as a surprise. Tehran University political observer Dr. Mohammad Marandi told RFI in an interview earlier in the week that a victory of the incumbent was “a 100 percent certainty.
"It never happened in the history of the Islamic Republic of Iran that an incumbent lost the election,” he says, pointing out that the campaign period of just one month was not enough for the relatively unknown challengers to make their point among the big public, no matter how hard they tried.
Rouhani now faces the massive task of delivering on his campaign promises, that include continuing a cash-burning subsidy plan and the complete lifting of international sanctions.
Indeed the economy will be his biggest headache.
“He has promised that ‘it’s been four years now that I’ve put everything in place and things are going to get better very soon,’” says Marandi.
“So if it is not going to get better in the next year, then he will be under increased criticism. So the next 18 months are going to be key to him.”
Marandi is not optimistic that Rouhani will be able to turn around the stagnant economy with an inflation rate of 11.9 percent in March this year.
The fact that on 17 May the US Treasury department added new sanctions over Iran’s ballistic missile program also won’t help the promise to have all sancitions lifted any time soon.
“If he does well in the next 18 months, I think that he will end his presidency pretty much successful, if he doesn’t, then I think the last part of his presidency will be difficult,” he says