YouTube should not have been forced to take down an anti-Muslim film that sparked violence in the Middle East and death threats to actors, a federal appeals court ruled Monday in a victory for free speech advocates. 

The 9th U.S. Circuit Court of Appeal sided with Google, which owns YouTube, after free speech advocates urged the court to overturn a 2-1 decision by three of its judges. The three judges had ordered YouTube to take down the video. 

Actress Cindy Lee Garcia wanted "Innocence of Muslims" removed from the site after receiving death threats. Her lawyer argued she had a copyright claim to the low-budget film because she believed she was acting in a different production. 

Google argued Garcia had no claim to the film because the filmmaker wrote the dialogue, managed the production and dubbed over her lines. 

It wasn't immediately clear if or when the video would be reposted on YouTube. A Google spokesman did not immediately respond to an email seeking comment. 

The film inspired rioting by those who considered it blasphemous to the Prophet Muhammad and President Barack Obama and other world leaders asked Google to take it down. 

Google, which said those requests amounted to censorship, was joined by an unusual alliance of filmmakers, other Internet companies and prominent news media organizations that didn't want the court to alter copyright law or infringe on First Amendment rights. 

YouTube and other Internet companies were concerned they could be besieged with takedown notices, though it could be hard to contain the film that is still found online. 

A lawyer for Google argued in December that if a bit player in a movie has copyright privileges, it could extend to minor characters in blockbusters, shatter copyright law and ultimately restrict free speech because anyone unhappy with their performance could have it removed from the Internet. 

"The ultimate effect is to harm the marketplace of speech," attorney Neal Katyal told the court during a hearing in Pasadena. 

Cris Armenta, a lawyer for Garcia, did not immediately respond to a request for comment Monday. But Armenta previously said the extraordinary circumstances justified the extreme action of a court injunction against YouTube. 

"She is under threat of death if she is not successful in removing it," Armenta argued. 

Garcia was paid $500 for a movie called "Desert Warrior" she believed had nothing to do with religion. But ended up in a five-second scene in which her voice was dubbed over and her character asked if Muhammad was a child molester. 

The film drew the attention of federal prosecutors, who discovered that filmmaker Mark Basseley Youssef used several false names in violation of probation from a 2010 check fraud case. He was sent back to prison in 2012 and was released on probation in September 2013.