Pakistan blocked the social networking website Twitter for several hours because it refused to remove tweets considered offensive to Islam, said one of the country's top telecommunications officials.

The tweets were promoting a competition on Facebook to post images of Islam's Prophet Muhammad, said Mohammad Yaseen, chairman of the Pakistan Telecommunication Authority. Many Muslims regard depictions of the prophet, even favorable ones, as blasphemous.

The government restored access to Twitter before midnight Sunday, about eight hours after it initially blocked access, possibly because of public criticism it received for its censorship.

Twitter spokesman Gabriel Stricker said the company had not taken down any tweets or made any other changes before Pakistan stopped blocking the site.

Yaseen said Sunday afternoon that Pakistan's Information Technology Ministry had ordered the telecommunications authority to block Twitter because the company refused to remove the offending tweets.

Facebook caves to demands

The ministry informed Yaseen to restore access to Twitter on Sunday evening, but he did not know what led to the decision.

Yaseen said Facebook had agreed to address Pakistan's concern about the competition.

Facebook confirmed in a written statement that it blocked access to the content in Pakistan. The site noted that it occasionally restricts content when it is illegal or offensive out of respect for local laws and culture.

Even when Twitter was blocked Sunday, many people based in Pakistan continued to use the social-networking service by employing programs that disguise the user's location.