Plans for the "Everybody Draw Mohammed Day" contest drew an angry reaction, provoking street demonstrations in the Muslim majority country.
Yesterday the Lahore High Court responded to a petition by the Muslim Lawyers Movement, ordering Pakistan's internet regulator to block the entire site.
Users lost access to Facebook about two hours later.
Rai Bashir, a lawyer involved in the case, said the site was blasphemous.
"There are so many insults to the Prophet on the internet and that's why we felt we had to bring this case," he said.
"All Muslims in Pakistan and the world will be supporting us."
The Facebook contest was based on an idea by Seattle-based artist Molly Norris, who posted a cartoon on her website of a chair, cotton reel, cherry and other items each claiming to be Mohammed.
However, she said her idea was only ever a spoof. It was meant as a protest against censorship of the television show South Park, she said. The US cartoon recently featured the Muslim prophet dressed in a bear suit.
She added that she was horrified that her satire had been turned into a Facebook competition.
The Pakistani Telecommunications Authority, which is in charge of internet access said it had chosen to block YouTube because certain people were using the world’s most popular video-sharing site to upload the Facebook images of Mohammed – which many Muslims found blasphemous.
A YouTube spokesperson: "We have received reports that the Pakistan Telecommunications Authority has ordered Internet Service Providers (ISPs) in Pakistan to block access to YouTube. We are looking into the matter and are working to ensure that the service is restored as soon as possible."
It is widely considered offensive to visually depict the Muslim prophet. The Koran does not explicitly forbid images of Mohammed, but a number of hadith, or interpretations of the Islamic holy book, forbid figural representations.
The Lahore court ordered Facebook to be blocked until May 31 – after the date of the contest – when a longer hearing is expected.
It is not the first time Pakistanis have reacted angrily to depictions of the Prophet Mohammed.
Tens of thousands of protesters took to the streets in 2006 when cartoons, which had originally been published in a Danish newspaper, were reprinted around the world.
Five people died when the demonstrations turned violent.
Two and half million Pakistanis have Facebook profiles and approximately 20 million people are internet users.