“Restore Facebook. We do not want to block access to information,” said Lahore High Court judge Ejaz Chaudry.
Authorities in the Muslim country originally shut the network in response to an inflammatory contest organised by an anonymous user calling on people to draw the Prophet Mohammed to promote “freedom of expression”.
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.
Facebook was still inaccessible in the country several hours after the court order and a spokesman for the Internet Service Providers Association of Pakistan said they were awaiting written orders.
In 2006, a Danish newspaper sparked violent demonstrations after publishing cartoons of the prophet Mohammed. Islam strictly prohibits any depiction of the prophet.