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 US 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 US 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 US 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 US Embassy in Islamabad said it had suspended public services due to the potential for demonstrations near the compound.
Pakistan's US-backed government faces a Taliban insurgency supported by al Qaeda and other militant groups