Tehran: A technical glitch allowed some Iranians temporary access to banned social networking websites Facebook and Twitter, an Iranian internet official said on Tuesday.

Surprised internet users in Iran on Monday night were able to log onto their accounts without using illegal software that enables them to circumvent a widespread state-run filtering mechanism.

They voiced their delight online, with posts revelling in the rare web freedom - restricted in 2009 when social networking sites enabled protesters to organise anti-government demonstrations in the aftermath of a disputed presidential election.

"Dear friends in America, do you believe miracles?! Well one has just apparently happened in Iran and the government in Tehran has lifted its filtering on Facebook!!!," said an overwhelmed Mehdi on his page.

Ali joined in, referring to the election of moderate President Hassan Rowhani, who has promised to bring more social freedoms.

He said in a tweet: "Twitter and Facebook has been freed! Rowhani thank you!"

But on Tuesday, Iranian state media reported that the unblocked access - to the websites the Iranian regime considers as undermining the Islamic regime - was being investigated.

Abdul Samad Khoramabadi, the secretary of an official group tasked with detecting internet content deemed illegal, told the Mehr news agency that "it was apparently due to a technical glitch and the committee is investigating it."

"If there had been any negligence, it will be punished," he said adding that he was unsure of the origin of the problem.

Such incidents have happened in the past, giving Iranians temporary, unfiltered access to the Internet.

But by Tuesday morning, access to the sites was once again blocked.

A Twitter user, Sima, was dismayed: "What a joy was last night, logging onto Twitter without the VPN ... #sigh."

The incident came a few days after Iran's Foreign Minister Mohammad Javad Zarif had its Twitter account officially verified by the social networking site - even though it is technically illegal for him to have one at all.

Iran systematically blocks access to Twitter, Facebook, YouTube and numerous other sites, including blogs and pornographic pages, as it tries to stop its population from surfing content it deems threatening or immoral.