Google has temporarily blocked YouTube users in Libya and Egypt from viewing clips from the US amateur film Innocence of Muslims.
Google blocked YouTube access to the film following the death of the US ambassador to Libya during protests in the Libyan city of Benghazi over the video.
Reuters reported that the entire YouTube website has been shut down in Afghanistan to prevent citizens from watching the film.
Aimal Marjan, general director of information technology at the Afghan government's Ministry of Communications, said YouTube had been banned from Afghanistan until the Innocence of Muslims video is taken down.
The US-produced film provoked violent protest in Egypt and Libya that led to the deaths of four Americans, including the US ambassador to Libya, J Christopher Stevens.
Armed men attacked the US consulate in Benghazi, Libya on Tuesday night, following the protests over the film which critics say portrays the Prophet Muhammad as a fraud and philanderer.
While Google has blocked the videos in Libya and Egypt, the company has refused to remove the video, as is does not violate YouTube’s policies.
In a statement, Google said: “What's OK in one country can be offensive elsewhere. This video – which is widely available on the web – is clearly within our guidelines and so will stay on YouTube.
"However, given the very difficult situation in Libya and Egypt, we have temporarily restricted access in both countries. Our hearts are with the families of the people murdered in yesterday's attack in Libya.”
According to CBS News, US officials have stated the protest over the film was not the cause of the deaths. Some US commentators claimed the armed group of men took advantage of the demonstration to attack the US consulate.