Pakistan restored access to Facebook on Monday, nearly two weeks after closing the popular networking site in a storm of controversy about blasphemy, but still restricted hundreds of online links.
A contest organised by an anonymous Facebook user calling on people to draw the Prophet Mohammed to promote "freedom of expression" sparked a major blacklash and angry street protests in the conservative country of 170 million.
Islam strictly prohibits the depiction of any prophet as blasphemous and even moderate Muslims were deeply offended by the drawings that appeared on a Facebook page in response to the call for an "Everyone Draw Mohammed Day".
A group of Islamic lawyers on May 19 petitioned a court in Pakistan's cultural capital of Lahore, which ordered Facebook blocked until May 31.
The Pakistan Telecommunications Authority (PTA) then banned popular video sharing website YouTube for a week and restricted access to 1,200 Internet links, including Wikipedia pages, citing "growing sacrilegious" content.
Justice Ejaz Chaudhry of the Lahore High Court on Monday ordered Facebook restored, but asked the government to develop a system to block access to "blasphemous" content online, as in Saudi Arabia.
"Restore Facebook. We don't want to block access to information," Chaudhry said.
"It is the government's job to take care of such things, which spark resentment among the people and bring them on to the streets. They should take steps to block any blasphemous content on the Internet," Chaudhry said.
The court adjourned until June 15 the petitions from the Islamic lawyers.
Although the caricatures were universally condemned in Pakistan, the Internet-literate elite has criticised the blanket ban on websites in a country with an estimated 2.5 million Facebook users.
Facebook expressed disappointment at being blocked and the offending page has disappeared from the social networking service.
But Mudassir Hussain, an official from the information technology ministry, told the court that all links to "blasphemous" content on the Internet would remain blocked in Pakistan.
Access to Facebook was being restored in the evening, around nine hours after written instructions were received, said a spokesman for the Internet Service Providers' Association of Pakistan.
"My technical staff say that it is open now," Wahaj-ul-Siraj said.
PTA spokesman Khurram Mehran said: "We issued instructions to Internet service providers to unblock Facebook. However pages containing blasphemous content will remained blocked."
Pakistan last week restored access to YouTube -- which together with Facebook accounts for up to 25 percent of Internet traffic in Pakistan -- but 1,200 web pages of "sacrilegious" content have been blocked.
Islamic activists and students have taken to the streets, shouting "Death to Facebook" and burned US flags, venting anger over "Everyone Draw Mohammed Day."
Pakistan also briefly banned YouTube in February 2008 in a similar protest against "blasphemous" cartoons of the Prophet Mohammed.