The move came almost two weeks after Pakistan imposed the ban amid anger over a page that encouraged users to post sacrilegious images.

"In response to our protest, Facebook has tendered their apology and informed us that all the sacrilegious material has been removed from the URL," said Najibullah Malik, secretary of Pakistan's information technology ministry, referring to the technical term for a Web page.

Facebook assured the Pakistani government that "nothing of this sort will happen in the future," Malik said.

Officials from the website could not immediately be reached for comment. They said earlier the contents of the "Everybody Draw Mohammed Day!" page did not violate Facebook's terms.

The page encouraged users to post profane images to protest threats made by a group against the creators of the American TV series "South Park" for depicting Muhammad in a bear suit during an episode earlier this year. Pakistan blocked Facebook on May 19 following a ruling by one of the country's highest courts. The Lahore High Court reversed its ruling Monday because of Facebook's response, paving the way for the government to restore access, Malik said. The government will continue to block some Web pages that contain "sacrilegious material," but Malik declined to specify which ones.

The Facebook controversy sparked protests across Pakistan, many by student members of Islamic groups. Some of the protesters carried signs advocating holy war against the website for allowing the page. Bangladesh also decided to block Facebook on Sunday but said it would restore access to the site if the offensive material was removed.

Pakistan and other Muslim countries saw large and sometimes violent protests in 2006 when a Danish newspaper published offensive cartoons and again in 2008 when they were reprinted. Later the same year, a suspected Al-Qaeda suicide bomber attacked the Danish Embassy in Islamabad, killing six people.

Anger over the Facebook controversy also prompted the Pakistani government to block access to YouTube briefly, saying there was growing sacrilegious content on the video sharing website. The government restored access to YouTube last week but said it would continue to block videos offensive to Muslims that are posted on the site.