TEHRAN — Internet users in Iran were surprised on Monday to find that they could access Facebook and Twitter without having to evade the government’s firewall, which had blocked direct access to the Web sites for years.

It was not immediately clear whether the government had made an official decision to stop blocking the sites, which it walled off from Iranian users in 2009, saying they were being used by antigovernment protesters to organize demonstrations. To reach the sites, many Iranians began using virtual private network, or VPN, software to connect through computers located outside the country, though the telecommunications ministry eventually deployed technology to block much of that kind of traffic as well.

The country’s new president, Hassan Rouhani, has promised several times to reduce Internet censorship, and several of his cabinet ministers, including the foreign minister, Mohammad Javad Zarif, have set up Facebook pages and opened Twitter accounts, some of them quite active.

Iranian Internet users reacted to the apparent unblocking on Monday as if a digital Berlin Wall had just crumbled on their computer screens.