A Pakistani resident uses a computer to browse a newspaper Web site in Quetta on May 20, 2012, after the country's government blocked social networking Web site Twitter. (Banaras Khan/AFP/Getty Images)

Pakistan’s telecommunications regulators shut down Twitter for about eight hours Sunday because the social networking site would not remove content that the government found objectionable to Muslims, but the nation’s prime minister stepped in to reverse the ban, officials said.

Such Internet censorship, though not unheard of in this majority-Muslim nation, surprised some Pakistani officials, lawmakers and politicians who regularly use Twitter. Interior Minister Rehman Malik, for instance, initially insisted that Twitter would not be blocked, but he later realized it was.

Malik, a regular Twitter user, said Sunday evening that Prime Minister Yousuf Raza Gilani ordered Pakistan’s Ministry of Information Technology to restore access to the site.

Details on the allegedly offensive tweets were unavailable, but they apparently urged participation in “Everybody Draw Muhammad Day,” a campaign launched two years ago that Muslims worldwide have denounced for encouraging depictions of Islam’s prophet, which adherents consider blasphemous.

The campaign led a Facebook user to set up a Facebook page to promote May 20 as “Everybody Draw Muhammad Day” to support freedom of expression. A Pakistani court ordered the page blocked two years ago when it was created.

In banning Twitter, Pakistan joined a list of countries including China, Burma, the United Arab Emirates and Libya that have denied their citizens access to the micro-blogging site, according to free-speech advocates.

It was not clear who in the Pakistani government directed that Twitter be blocked Sunday afternoon, but “this is not a simple decision, it is a high-level decision,” said Mohammad Yaseen, chairman of the Pakistan Telecommunication Authority.

Some Pakistani Twitter users immediately downloaded software to circumvent the ban, while others were able to tweet via smartphones.

“As a citizen of #Pakistan and as a former journalist I condemn the blocking of #Twitter. Freedom of speech is an inviolable right,” tweeted Farahnaz Ispahani, a member of Parliament and media adviser to President Asif Ali Zar­dari.

In negotiations with Pakistani officials, Facebook agreed to continue to prevent the “Draw Muhammad” page from being accessed in Pakistan, but Yaseen said Twitter would not cooperate. That led to a directive from the Ministry of Information Technology that ordered telecom providers to block Twitter access in the country.

Officials began negotiating Saturday evening with Twitter “to remove this content, this objectionable Web site which is objectionable to the Muslims of this country,” Yaseen said.

“Will start looking into it,” tweeted Pakistan’s ambassador to Washington, Sherry Rehman, who was in Chicago on Sunday for the opening of the NATO summit focused on the future of Afghanistan.

“The fact that despite their ‘Twitter Ban’, we are still tweeting from Pakistan, should tell them how stupid it is to censor [the] internet,” Marvi Sirmed, a human rights activist and member of a national media monitoring committee, said in a tweet.

“I am so ashamed of my Information Technology Ministry,” she added in an interview. “It shows how ignorant they are. I am so enraged at this point in time. It is making Pakistan a laughingstock of the entire world.”

Pakistan’s IT ministry faxed its content-removal request to Twitter. Company spokesman Gabriel Stricker said Twitter took no action.

Some Twitter regulars suggested that the government blocked the site to appease religious fundamentalists, but Cyril Almeida, a columnist at the daily Dawn newspaper, blamed bureaucratic bungling.

“This is what happens when you have a government that doesn’t know how to do anything right,” Almeida said. “Somebody somewhere had the authority to do it and went ahead and did it, without some grand conspiracy.”

In Pakistan, even the most liberal politicians tread lightly when dealing with the issue of blasphemy, especially since the assassination last year of Salman Taseer, the governor of Punjab province and a leader of the ruling Pakistan People’s Party, by a member of his security detail. The confessed killer cited Taseer’s opposition to ­anti-blasphemy laws and was lauded as a hero by a group of 500 Muslim scholars as well as many ordinary Pakistanis.

The “Draw Muhammad” contest was started by a Seattle artist, Molly Norris, who created a cartoon after threats were made against the Comedy Central show “South Park” for depicting Muhammad in a bear suit.

Malik said Pakistan registered a protest with Twitter and sought an apology for “this contest of blasphemous caricatures.”

Special correspondents Shaiq Hussain and Michele Langevine Leiby in Islamabad contributed to this report.