It appears to be the first time a senior Iranian official has indicated the country is seeking to defeat COVID-19 via herd immunity.
The virus has killed more than 588,000 people and infected nearly 14 million around the world since first being detected in China late last year.
Iran has been battling a resurgence of COVID-19, with figures showing a rise in both new infections and deaths since a two-month low in May.
On Saturday, the health ministry reported another 188 coronavirus deaths and 2,166 cases of infection in the past 24 hours.
That took the overall toll to 13,979 dead out of 271,606 cases since Iran reported its first cases in mid-February.
The rising toll has prompted authorities to reimpose restrictions in worst-hit provinces after being lifted country-wide in April, with Tehran extending them for an extra week on Friday.
"Our estimate is that up to now, 25 million Iranians have been infected with this virus," Rouhani said during a televised meeting of the country's virus-fighting taskforce.
"We have to consider the possibility that 30 to 35 million more may face infection," he added, citing the results of a study by the health ministry.
"We have not yet achieved herd immunity and we have no choice but to be united and break the chain of transmission of the coronavirus."
Rouhani's deputy head of communications, Alireza Moezi, said on Twitter hours later that the 25 million in fact refers to "those who have encountered the virus and achieved complete immunity".
Rouhani also said that Iran may have to prepare itself for double the amount of hospitalisations it has had in the past five months, according to the study.
The study shows that "out of every 1,000 infected, 500 show no symptoms" Rouhani added, warning that they present the main challenge by "spreading more virus and over a longer period" than those identified.
The health ministry does not report the overall amount of hospitalisations over COVID-19.
The Islamic republic has been struggling to contain the Middle East's worst COVID-19 outbreak since announcing its first cases in mid-February.
Iran has refrained from imposing full lockdowns but closed schools, cancelled public gatherings and banned travel between provinces in March, before lifting the restrictions the next month to reopen its sanctions-hit economy.