By Jim Christie

SAN FRANCISCO, May 26 (Reuters) - A U.S. jury handed Alphabet's Google a major victory on Thursday in a long-running copyright lawsuit against Oracle Corp , saying the law allowed Google's use of Oracle's software to create its Android smartphone operating system.

The jury unanimously upheld claims by Google that its use of Oracle's Java development platform was protected under the fair-use provision of copyright law, bringing trial to a close without Oracle winning any of the $9 billion in damages it requested.

Oracle in a statement after the verdict said it would appeal.

In a retrial at U.S. District Court in San Francisco, Oracle said Google's Android operating system violated its copyright on parts of Java, a development platform. Alphabet's Google unit said it should be able to use Java without paying a fee under fair use.

A trial in 2012 ended in a deadlocked jury.

The trial was closely watched by software developers, who feared an Oracle victory could spur more software copyright lawsuits. However, investors saw little risk for Alphabet.

Shares of Oracle and Alphabet were little-changed in after-hours trade following the verdict.

After the first trial, U.S. District Judge William Alsup ruled that the elements of Java at issue were not eligible for copyright protection at all. A federal appeals court disagreed in 2014, ruling that computer language that connects programs - known as application programming interfaces, or APIs - can be copyrighted.

A flood of copyright lawsuits has failed to materialize in the two years since that federal appeals court ruling. That could suggest Oracle's lawsuit will not ultimately have a wide impact on the sector.

Under U.S. copyright law, "fair use" allows limited use of material without acquiring permission from the rights holder for purposes such as research.

During retrial, Oracle attorneys deemed Google's defenses the "fair-use excuse."

The retrial, which lasted about two weeks, featured testimony from high profile executives including Alphabet Executive Chairman Eric Schmidt, Chief Executive Larry Page, and Oracle co-CEO Safra Catz.

(Additional reporting by Dan Levine; Editing by Andrew Hay) ((dan.levine@thomsonreuters.com; +1 415 348-4726;))