In an order issued yesterday, Justice Sheikh Azmat Saeed directed the Information Technology Ministry to "deny access to all websites in Pakistan involved in spreading religious hatred".
However, the judge directed the ministry that access to Google or other search engines should not be denied. He directed the authorities to submit a report on the implementation of the court’s order by October 6.
The judge issued the order in response to a petition seeking a permanent ban on US-based Facebook for hosting a competition on blasphemous caricatures of Prophet Mohammed.
Lawyer Muhammad Azhar Siddique, who had filed the petition, said Islamic values were being insulted in the name of access to information and this was hurting the feeling of billions of Muslims across the world.
Despite an earlier order of the High Court, the Information Technology Ministry had not blocked websites spreading religious hatred, Siddique claimed.
Siddique also asked the court to direct the federal government to stop the display of material considered blasphemous by any religion or insulting to the Prophet Mohammed on all websites in Pakistan.
He said the government should be directed to establish a permanent authority with legal status, which could monitor such "objectionable activities" across the world.
Pakistani authorities had briefly barred access to Facebook last year on the orders of the Lahore High Court.