"We are probing it," he said.
Later, a telecommunications official, Hasan Karimi, said the web openings were caused by internet address changes by Facebook that required taking down the filters to install new firewalls.
Facebook did not immediately respond to an Associated Press request for comment.
Some Rouhani backers, however, believe the Iranian government had a hand in freeing up the internet, even if briefly.
Scores of Facebook users quickly posted "Rouhani, Mochakerim," or Farsi for "Thank you, Rouhani."
"God liberated Facebook," wrote Mohammad Reza on his Facebook account.
"This isn't really about a glitch even if one really happened," said Scott Lucas, an Iranian affairs expert at Britain's Birmingham University and editor of EAWorldView, a foreign policy website. "The bigger picture is that the internet is central to the political battles inside the country in both the direction of domestic and foreign affairs."
The clampdown on Iran's social media was in response to the street riots and unrest after the disputed 2009 re-election of Mahmoud Ahmadinejad, whose opponents were among the first in the Middle East to harness the web to organise protests.
Ironically, Iranian officials also have recognised the usefulness of the social media they consider too dangerous to be allowed in the public domain.
Accounts carrying the name of Supreme Leader Ayatollah Ali Khamenei typically churn out dozens of comments a day. Authorities insist Khamenei does not maintain his own accounts, but he has not disavowed them - raising speculation that they are fed by close aides and have his tacit approval.
On Tuesday, the Khamenei-branded Twitter account equated diplomacy to a wrestling match. It's good to grapple, it said, but important to member you are still foes - an apparent reference to possible increased outreach to the US during Rouhani's trip to New York later this month for the UN General Assembly. The comment was similar to an earlier state TV report quoting Khamenei.
Khamenei's top aides, including former nuclear negotiator Saeed Jalili, were ahead of even Rouhani in embracing social media during this year's presidential race.
"Now some of the group that has been resisting (social media) is changing its mind," said Tehran-based political analyst Saeed Leilaz.
But there are powerful hard-line factions that want no official cracks in what US President Barack Obama once called Iran's "electronic curtain".
Iran's Supreme Council for Cyberspace, the main oversight body, is directly linked to the Revolutionary Guard and the ruling clerics. Both groups have given no signals of interest in easing the internet blocks on millions of websites that range from opposition voices to the BBC's Persian Service.
The country's young and highly educated population is adept at beating the controls through proxy service sites and other methods. Rouhani believes it's time to lift them from the shadows of the cyber world.
In a speech to parliament in August to introduce his telecommunications minister, Mahmoud Vaezi, Rouhani told lawmakers that Iran needs "active foreign communication to connect Iranian enterprises to the outside world for both transferring technology and entrepreneurship".
On Monday, Rouhani pushed into more difficult territory. In a carefully worded speech to Revolutionary Guard commanders, he reminded them of their role as guiding a military and industrial force that should leave politics to others.
"The (Guard) is above and beyond political currents, not beside them or within them," state TV quoted Rouhani as saying. "The Guard has a higher status."
Rouhani, meanwhile, has developed an active Twitter presence with a feed that is believed to be run by his close aides - although his office has left the actual stewardship of the account vague. Many of Rouhani's Cabinet members also have opened Facebook accounts.
Earlier this month, Foreign Minister Mohammad Javad Zarif posted a Twitter message marking the Jewish new year, Rosh Hashanah, for Iran's Jewish community and others around the world. It also was seen as a small bid toward easing hostilities between his nation and Israel.
One frustrated Facebook user, Vahid Shariat, bemoaned after the blocks were re-imposed: "When government ministers are using Facebook and other (social media) networks, why isn't it good enough for us?"
- AP