A US appeals court has ordered Google to remove an anti-Islamic video from YouTube that sparked protests across Muslims in Egypt, Libya and other countries in 2012.

The lawsuit was filed by US actress Cindy Lee Garcia who said she she was duped into appearing in the movie without knowing its controversial anti-Muslim slant.

The decision by the court ruled "that irreparable harm would result if an injunction did not issue because she was subject to death threats and took action as soon as she began receiving the threats."

The launch of the film called Innocence of Muslims on the video-sharing site resulted in riots and several deaths in the Middle East during the protests.

The controversial movie has also been linked to the attack on a US diplomat in Benghazi and Libya, killing four US citizens including the US ambassador.

Until now, YouTube had been refusing to take down the film from the site, arguing that only the filmmaker and not the actress, owned the exclusive rights to remove the video.

Garcia’s lawyer Cris Armenta said that ordering YouTube and Google to take down the film was the right thing to do.

"The propaganda film differs so radically from anything that Ms. Garcia could have imagined when the director told her that she was being cast in the innocent adventure film," Armenta said.