Friday's twin elections - to parliament and to top clerical committee, the Assembly of Experts - were crucial for the president and a de-facto referendum on his administration after its nuclear deal with world powers.
In the parliamentary election, hardliners who vocally opposed Rouhani's diplomacy with the West and his moves to open Iran up to foreign investment were soundly beaten by reformists. Conservatives also lost seats.
"The owners of this country are the people... They determine the path and direction of this country," the president said.
Buoyed by new backing from reformists supportive of the government, the president urged a spirit of cooperation among MPs from across Iran's political spectrum.
Also Read
"If there are still some who think that the country must be in confrontation with others, they still haven't got the message of 2013," he said, alluding to his landslide presidential election victory on a pledge to end years of standoff over Iran's nuclear programme and crippling sanctions.
No single group won a decisive share of parliament's 290 seats, but tallies suggested the pragmatic Rouhani would be able to forge a working majority.
While conservatives were wiped out by reformists in Tehran, they retained some seats in other cities and enjoyed strong support in rural areas.
Some 69 constituencies had no clear winner, meaning a second round runoff in April in a field that has more conservatives than reformists and moderates.
The outcome signalled strong public support for the nuclear deal between Iran and world powers, an agreement steered by the president which saw the lifting of sanctions in January.
Friday's second election for the Assembly of Experts also produced high-profile gains for Rouhani and his closest allies.