Image caption Muslims consider it un-Islamic to draw pictures of the Prophet Muhammad

A court in Pakistan has ordered the authorities to restore the Facebook social networking site.

The court had ordered the blocking of the site after a petition was filed against a competition featuring caricatures of the Prophet Muhammad.

The petition, filed by a lawyers' group called the Islamic Lawyers' Movement, said the contest was "blasphemous".

Pakistan's deputy attorney told the court on Monday that Facebook had withdrawn the competition.

The Facebook page in question contained caricatures of the Prophet Muhammad and characters from other religions, including Hinduism and Christianity, as well as comments both critical and supportive of Islam.

On Monday, Justice Ejaz Ahmed Chaudhry of the Lahore High Court reversed his 19 May order to the Pakistani authorities to block the site.

"Restore Facebook. We don't want to block access to information," Justice Chaudhry told the court.

He asked the government to develop a system to find out how countries like Saudi Arabia were blocking access to "blasphemous" content on the internet.

"It is the government's job to take care of such things, which spark resentment among the people and bring them onto the streets.

"They should take steps to block any blasphemous content on the internet," Justice Chaudhry said.

Last week, Pakistan restored access to popular video sharing website YouTube only after blocking some pages for "sacrilegious content".

Correspondents say that the internet is uncensored in Pakistan but the government monitors content by routing all traffic through a central exchange.

In the past, Pakistan has often blocked access to pornographic sites and sites with anti-Islamic content.

It has deemed such material as offensive to the political and security establishment of the country, says the BBC's M Ilyas Khan in Islamabad.

In 2007, the government banned the YouTube site, allegedly to block material offensive to the government of Pervez Musharraf.

The action led to widespread disruption of access to the site for several hours. The ban was later lifted.