By PAUL ELIAS, Associated Press

SAN FRANCISCO (AP) — A U.S. appeals court ordered YouTube on Wednesday to take down an anti-Muslim film that sparked violent riots in parts of the Middle East and death threats to the actors.

The decision by a divided three-judge panel of the 9th U.S. Circuit Court of Appeals in San Francisco reinstated a lawsuit filed against YouTube by an actress who appeared briefly in the 2012 video that led to rioting and deaths because of its negative portrayal of the Prophet Muhammad.

YouTube resisted calls by President Barack Obama and other world leaders to take down the video, arguing that to do so amounted to unwarranted government censorship and would violate the Google-owned company's free speech protections. Besides, the company argued that the filmmakers and not the actors of "Innocence of Muslims" owned the copyright and only they could remove it from YouTube.

And typically, that's the case with the vast majority of clips posted on YouTube — and Hollywood in general — that don't violate decency laws and policies. But the 9th Circuit said Wednesday that this case was far from typical and that the actress, Cindy Lee Garcia, retained a copyright claim that YouTube must respect. That's because she believed she was acting in a different production than the one that ultimately appeared online.

"Had Ms. Garcia known the true nature of the propaganda film the producers were planning, she would never had agreed to appear in the movie," said Cris Armenta, Garcia's attorney.

Google argues that the actress had no claim to the film because filmmaker Mark Basseley Youssef wrote the dialogue, managed the entire production and dubbed over Garcia's dialogue during postproduction editing.

Writing for the court, Chief Judge Alex Kozinski said the ruling was not a blanket order giving copyright protection to every actor, but that in this case, Garcia's performance was worthy of copyright protection.

"We need not and do not decide whether every actor has a copyright in his performance within a movie," the judge wrote. "It suffices for now to hold that, while the matter is fairly debatable, Garcia is likely to prevail."

Judge N. Randy Smith dissented, arguing that Garcia's five-second appearance gave her no ownership claims.

"Her brief appearance in the film, even if a valuable contribution to the film, does not make her an author," Smith wrote. "Indeed, it is difficult to understand how she can be considered an 'inventive or master mind' of her performance under these facts."

Youssef, the filmmaker, was sentenced to 21 months in prison for check fraud in 2010 and barred from accessing the Internet without court approval. He was returned to prison in 2012 for violating terms of his probation and was released on probation in September 2013.

Garcia was paid $500 to appear for five seconds in a film she was told was called "Desert Warrior" that she thought had nothing to do with religion or radical Islam. When the clip was released, her lines were dubbed to have her character asking Muhammad if he was a child molester.

"This is a troubling case," Kozinski wrote. "Garcia was duped into providing an artistic performance that was used in a way she never could have foreseen. Her unwitting and unwilling inclusion in Innocence of Muslims led to serious threats against her life. It's disappointing, though perhaps not surprising, that Garcia needed to sue in order to protect herself and her rights."

For Google, the ruling represents a nettlesome issue if allowed to stand. The company fears that bit players and extras appearing in popular clips will now be emboldened to send takedown notices to YouTube unless settlements can be reached with the filmmakers.

Google, which has removed the clip, said it will appeal the decision. It could ask a special panel of 11 judges of the 9th Circuit to rehear the case or petition the U.S. Supreme Court to take the case.