A jury in San Francisco on Thursday cleared Google of copyright infringement in a case brought by Oracle over Google’s use of Java in Android.

The jury of eight women and two men took three days of deliberation to reach its verdict. Oracle was seeking up to $9 billion in damages, making it a huge victory for Google and its legal team. Oracle is expected to appeal, however, which means the case may yet drag on.

"Your work is done," Judge William Alsup told the jury after the verdict was read.

Oracle's lawyers sat stoney faced. The reaction from Google's legal team was also muted at first, though they stood smiling and embraced after the jury was led out of the room.

Judge Alsup said he wished to thank the jurors personally in the jury room. They announced they had reached their verdict just moments before they were due to break for the day. A previous jury failed to reach an agreement on the fair use question, and there was a chance this jury might have done the same.

At issue was Google’s decision to copy 37 Java application programming interfaces, including thousands of lines of "declaring" code, into its Android operating system.

Since the trial began on May 10, the jury has heard evidence from a parade of Silicon Valley bigwigs including Google's Eric Schmidt and Larry Page, Oracle CEO Safra Catz, and former Sun Microsystems CEO Jonathan Schwartz.

Google's message to the jury was that Sun intended Java to be free for anyone to use, which is why it made the Java language open source in the first place. It cited a blog post from Schwartz, congratulating Google on Android's release, as evidence that Sun had no problem with Google's use of Java.

Oracle's lawyers painted a very different picture. Google was desperate to get its mobile operating system to market quickly, they told the jury, and after failing to secure a licensing deal with Sun, Google went ahead and used Java anyway. They dismissed Schwartz's blog post as a way to make Android look like a win for Sun.

“They knew they were breaking the rules, they knew they were taking shortcuts, and they knew it was wrong,” Peter Bicks, an attorney for Oracle, told the jury in his closing statement.

But the jury didn't buy Oracle’s argument.

The outcome is a small victory for software developers, who were alarmed by an earlier decision in the case that application programming interfaces can be protected under U.S. copyright law.

Many developers had assumed APIs weren’t eligible for protection, viewing them as functional elements of software that are required to make two programs interoperate.

The earlier decision that APIs are protected still stands, meaning some developers may be wary of using another company’s APIs without permission. But the fact that Google’s fair use defense prevailed could make large vendors like Oracle think twice about bringing similar lawsuits in future.

Oracle accused Google of infringing its copyright when it decided to use 37 Java application programming interfaces in its Android OS. Android has gone on to dominate the smartphone market, netting Google billions of dollars in profit.

Google originally argued that APIs like those in Java aren’t eligible for protection. The federal district court judge in the case agreed, but an appeals court overturned his ruling. Google asked the US Supreme Court to reconsider the matter, but it declined.

Google’s defense turned next to the legal doctrine of fair use, which allows copying of creative works under limited circumstances, most commonly for things like criticism, satire and educational use.

The jury had to consider four factors in deciding whether Google’s use was fair. They included whether its use of Java was “transformative,” or whether it created something new and different from the original copyright work, which in this case was Java Standard Edition.

They also had to consider the extent to which Android harmed Java in the marketplace. Google's lawyers argued that Sun never succeeded in the smartphone market because it never built a decent smartphone OS - not because of Android.

It's a civil case, which means Google had to prove by a "preponderance of the evidence" that its use of Java was fair. That's a lower burden than in a criminal trial, when Google would have had to prove its case "beyond reasonable doubt."

The jury was required to reach a unanimous decision. A previous trial over the same issue ended with a hung jury, so the case had to be retried. In the earlier case, a majority of jurors concluded Google's use of Java was fair.

To comment on this article and other PCWorld content, visit our Facebook page or our Twitter feed.