"From July 5, wearing masks in all public areas will be compulsory for two weeks," Rouhani said on Sunday at a meeting of the National Headquarters for Managing and Fighting the Coronavirus, Xinhua news agency reported.
If necessary, the new decision will remain in force for the next month, he was quoted as saying by official IRNA news agency.
He also said those who fail to observe the health measures and regulation will be penalized.
According to Deputy Health Minister Iraj Harirchi, the use of mask and respect to social distancing are "a must" in the provinces which are in high-risk condition.
Disrespect to social distancing and disregard of health protocols are the main reasons for the resurgence of the pandemic in some of the cities in the country, Harirchi was quoted as saying by IRNA.
Also, services will not be given to those without masks in areas such as government organizations and shopping malls, he said.
Rouhani said on Sunday that the health ministry has provided a list of spaces and gatherings which are regarded as high-risk areas.
The use of masks and protective gears has been optional in most areas in Iran.
Iranian officials have hinted that they may reimpose restrictive measures.
Rouhani also said on Sunday that the current year is the hard year for Iran as the country is grappled with economic pressures, due to the U.S. sanctions, as well as the outburst and endurance of novel coronavirus disease.
But, the Islamic republic will hopefully overcome this tough situation in unity, he stressed.
Iran reported its first COVID-19 cases on Feb. 19. It imposed restrictions late in the month and started to gradually ease the restrictions from April.
Iran's confirmed coronavirus cases rose to 222,669 on Sunday after an overnight registration of 2,489 new infections, IRNA reported.
Sima Sadat Lari, spokeswoman for Iran's Ministry of Health and Medical Education, said at her daily briefing that out of the new cases in the past 24 hours, 1,406 have been hospitalized.
The pandemic has so far claimed the lives of 10,508 Iranians, up by 144 in the past 24 hours.
Besides, 183,310 have recovered and been discharged from hospitals while 2,946 remain in critical condition.
According to Lari, 1,610,869 lab tests for COVID-19 have been carried out in Iran as of Sunday.
The Iranian health official said that five provinces are still in high-risk condition.
Iran and China have offered mutual help in combating the COVID-19 pandemic.
In mid-February, at the early stage of the coronavirus outbreak in China, Iran lit up the Tehran Azadi (Liberty) Tower to show its solidarity with China, and donated 3 million masks to China.
In return, China has delivered several shipments of medical supplies to Iran. On February 29, a five-member Chinese medical team visited Iran for a month-long mission to help Iran fight the pandemic.