A Pakistani court ordered the government on Wednesday to block Facebook after press reports of a competition being held to draw the Prophet Mohammad, a lawyer said.

Pakistani media recently reported that a caricature competition is being held on May 20 about Mohammad on Facebook.

The court has ordered the government to immediately block Facebook until May 31 because of this blasphemous competition, Azhar Siddique, a representative of the Islamic Lawyers Forum who filed a petition in the Lahore High Court, told Reuters.

The court has also ordered the foreign ministry to investigate why such a competition is being held.

A spokesman for the official telecommunications watchdog, Pakistan Telecommunication Authority, said the government on Tuesday ordered Internet service providers to block websites showing these caricatures, but that they had not received the court orders as yet.

Any representation of the Prophet Mohammad is deemed un-Islamic and blasphemous by Muslims.

But some warned the court's response could backfire.

Blocking the entire website would anger users, especially young and adults, because the social networking website is so popular among them and they spend most of their time on it, said the CEO of Nayatel, Wahaj-us-Siraj.

Basically, our judges aren't technically sound. They have just ordered it, but it should have been done in a better way by just blocking a particular URL or link.

The PTA's decision (to block the URL) was rational and good, but let's see how they will implement the court decision.

On the information page on Facebook for the contest -- which was still visible on Wednesday -- the organizers described it as a snarky response to Muslim bloggers who warned the creators of the Comedy Central television show South Park over a recent depiction of the Prophet in a bear suit.

We are not trying to slander the average Muslim, the Facebook page creators wrote. We simply want to show the extremists that threaten to harm people because of their Mohammad depictions that we're not afraid of them. That they can't take away our right to freedom of speech by trying to scare us into silence.

Publications of similar cartoons in Danish newspapers in 2005 sparked deadly protests in Muslim countries. Around 50 people were killed during violent protests in Muslim countries in 2006 over the cartoons, five of them in Pakistan.

Al Qaeda claimed responsibility for a suicide attack on Denmark's embassy in Islamabad in 2008, killing six people, saying it was in revenge for publication of caricatures.

(Reporting by Mubasher Bukhari: additional reporting and writing by Zeeshan Haider; Editing by Chris Allbritton)