Pakistani Prime Minister Raja Pervez Ashraf ordered the suspension of YouTube in the country on Monday over a video made in the United States which mocks the Prophet Mohammad and has enraged the Islamic world.
The move came hours after police fired in the air to disperse a crowd headed towards the U.S. Consulate in the city of Karachi to protest against the amateurish film.
Ashraf's office said in a statement that the Ministry of Information had been ordered to block YouTube so that the video could not be viewed.
"The direction has been given after YouTube refused to heed to the advice of the government of Pakistan to remove blasphemous material from its site," said Ashraf's office.
"The prime minister said that blasphemous material would not be tolerated and the services of YouTube would remain suspended till removal of blasphemous material."
Muslims in Pakistan and elsewhere around the world have been seething over the video posted on the Internet under several titles including "Innocence of Muslims".
Protesters on motorcycles and in cars headed towards the U.S. Consulate in Pakistan's biggest city and commercial hub Karachi, prompting police to shoot in the air and fire teargas.
Protesters threw rocks at the police and damaged one of their vehicles. Around 100 people roamed roads and alleys near the sprawling consulate.
A senior police official said 30 students had been arrested.
Protests erupted in several Pakistani cities over the weekend.
In Lahore on Monday, protesters threw rocks at police and burned an American flag near the U.S. Consulate in images broadcast live on local television channels. Police official Rai Tahir said six policemen and some protesters were hurt.
"We used teargas and a baton charge," said Tahir. "We managed to push them back."
The U.S. Embassy in Islamabad said it had suspended public services due to the potential for demonstrations near the compound.
Pakistan's U.S.-backed government faces a Taliban insurgency supported by al Qaeda and other militant groups.