It was a Facebook campaign meant to make a stand for free speech. But in Pakistan, a contest encouraging users of the social-networking site to submit caricatures of the prophet Muhammad has been viewed as blasphemous, prompting a court-ordered nationwide ban on the website Wednesday.

A court in Lahore, Pakistan’s second-largest city, ordered the government to ensure that the country’s Internet service providers were blocking access to Facebook, the world’s most popular social-networking website. In the capital, Islamabad, the site was shut down as of early Wednesday evening.

The ruling was triggered by a campaign on Facebook asking users to post images of Islam’s founder on a page called “Everybody Draw Muhammad Day!”

The campaign was aimed at expressing solidarity with the creators of the Comedy Central television show “South Park,” which recently drew the ire of a radical Muslim group for depicting Muhammad in a bear suit during an episode earlier this year.

Afterward, a New York-based website called RevolutionMuslim.com warned South Park’s creators, Trey Parker and Matt Stone, that “what they are doing is stupid, and they will probably wind up like Theo Van Gogh.”

Van Gogh was a Dutch filmmaker murdered in 2004 in Amsterdam after he produced a film about the abuse of women in some Islamic societies. In the film, verses from the Koran are projected onto the shrouded bodies of women.

Facebook users were supposed to submit their images Thursday. On Wednesday, a group of Pakistani lawyers asked the Lahore high court to shut down Facebook in Pakistan, arguing that the contest amounted to blasphemy. The court ordered the site blocked until May 31, when the panel would again take up the case.

Although there are no statistics that quantify the number of users in Pakistan, Facebook has become immensely popular in the country, which has a vibrant blogging community that sinks its teeth into a variety of topics, including politics and the arts as well as the latest fashion trends.

Efforts such as Facebook’s “Draw Muhammad” campaign, however, “hurt us very badly, very seriously,” said Pakistani Information Technology Secretary Najibullah Malik.

“They should have regard for sentiments of Muslims, and they should not repeat such displays,” Malik said on Pakistani television. “They should know that if they are going to do such activities, certainly their business will suffer.”

The Facebook shutdown in Pakistan was just the latest in a series of controversies around the world involving clashes between those advocating free speech and the those espousing the tenets of Islam, which prohibit the depiction of Muhammad.

In 2005, a Danish newspaper published cartoons of Muhammad that were condemned throughout much of the Muslim world as blasphemous and derogatory. Earlier this year, the Pakistani American David Coleman Headley pleaded guilty to planning an attack on the Copenhagen offices of Jyllands-Posten, the newspaper that published the cartoons. Headley never carried out the attack.

Swedish cartoonist Lars Vilks received several death threats after publishing an image of Muhammad as a dog in 2007. At an appearance at Sweden’s Uppsala University earlier this month, several audience members tried to attack Vilks as he lectured. Two people were arrested.

alex.rodriguez@latimes.com