ISLAMABAD, Pakistan — A ban on YouTube, which Pakistan imposed after an anti-Islam video caused riots in much of the Muslim world, was lifted Saturday, only to be reinstated — after three minutes — when it was discovered that blasphemous material was still available on the site.

After months of criticism of the ban, the government decided to allow Pakistanis to have access to YouTube again, saying steps had been taken to ensure that offensive content would not be visible. But those efforts apparently failed, and the authorities quickly backtracked.

The ban was imposed on Sept. 17 following violent protests in response to the video, which was made in the United States and ridiculed the Prophet Muhammad. The government then ordered all telecommunications companies to block Internet material deemed offensive to Muslims and urged people to report such material.

But the ban on YouTube came to be seen as censorship, and a growing number of the estimated 25 million Internet users in the country complained.