Drawing caricatures and images of the prophet are considered blasphemous by most Muslims.
“We cannot block access to information,” said Justice Ejaz Ahmed Chaudhry, a High Court judge in the city of Lahore.
In the ruling, he ordered the government to block specific content considered blasphemous to Islam. He also called on the authorities to explore a central censorship system, such as those used in the United Arab Emirates and Saudi Arabia to block hate content.
The court will reconvene on June 15 to review the government’s progress.
The Islamic Lawyers Forum, the group that filed the original case to ban access to Facebook, rejected the court-ordered restoration on Monday, pledging to pursue what it called “a complete ban again” if the government doesn’t adequately censor hate content.
Outside the courtroom, protesters chanted slogans against Facebook.
The controversy erupted after a Facebook user created a page called “Everybody Draw Muhammad Day” and asked for submissions.
On May 19, thousands of Pakistanis responded with angry protests around the country. As a result, the Lahore High Court ordered the Pakistan Telecommunication Authority to block access to over 600 Web sites, including Facebook, YouTube and certain pages on Flickr and Wikipedia. Access to most sites has since been restored.
On Saturday, Bangladesh became the second country to block Facebook. As in Pakistan, the ban is expected to be temporary.