“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.
Rouhani´s hardline rival Ebrahim Raisi got 15.8 million votes, he said.
Following his resounding re-election victory, Rouhani said Iranians have chosen the “path of engagement with the world” and rejected extremism.
“The message of our people has been very clearly expressed. The Iranian people have chosen the path of engagement with the world, far from extremism,” he said on state television.
“The Iranian people want to live in peace and in friendship with the rest of the world, but it does not accept any threat or humiliation,” Rouhani said.
He took an apparent dig at regional rival Saudi Arabia, which is currently hosting US President Donald Trump.
“Our people have declared to neighbouring countries and the whole region that the path to ensuring security is the reinforcement of democracy and not relying on foreign powers.”