The case, decided by the U.S. Court of Appeals for the Federal Circuit in Washington, is being closely watched in Silicon Valley.
A high-profile 2012 trial featured testimony from Oracle's chief executive, Larry Ellison, and Google CEO Larry Page, and the legal issues go to the heart of how tech companies protect their most valuable intellectual property.
Google's Android operating system is the world's best-selling smartphone platform. Oracle sued Google in 2010, claiming that Google had improperly incorporated parts of Java into Android. Oracle is seeking roughly $1 billion on its copyright claims.
A San Francisco federal judge had decided that Oracle could not claim copyright protection on parts of Java, but on Friday the three-judge Federal Circuit panel reversed that ruling.
"We conclude that a set of commands to instruct a computer to carry out desired operations may contain expression that is eligible for copyright protection," Federal Circuit Judge Kathleen O'Malley wrote.
Pamela Samuelson, a professor at University of California, Berkeley, School of Law who wrote a brief supporting Google in the case, said the Federal Circuit's decision means software companies now face uncertainty in determining how to write interoperable computer programs that do not violate copyright.
"What we have is a decision that will definitely shake up the software industry," said Samuelson.
But Oracle attorney E. Joshua Rosenkranz said the law has always been clear on these issues. "There's nothing at all astounding in what the Federal Circuit did," he said.
NOT THE END OF LEGAL DISPUTE
The case examined whether computer language that connects programs - known as application programming interfaces, or APIs - can be copyrighted. At trial in San Francisco, Oracle said Google's Android trampled on its rights to the structure of 37 Java APIs.
U.S. District Judge William Alsup ruled that the Java APIs replicated by Google were not subject to copyright protection and were free for all to use. The Federal Circuit disagreed on Friday, ruled for Oracle and instructed the lower court to reinstate a jury's finding of infringement as to 37 Java API packages.
"We find that the district court failed to distinguish between the threshold question of what is copyrightable — which presents a low bar — and the scope of conduct that constitutes infringing activity," O'Malley wrote.
The unanimous Federal Circuit panel ordered further proceedings before Alsup to decide whether Google's actions were protected under fair use.
Programmers could still craft interoperable programs if the opinion stands, but lawyers will have to be more involved in signing off on what is permissible, said Eric Goldman, a professor at Santa Clara University School of Law.
"That's really expensive and lawyers are not going to give yes or no answers, and that's going to be stressful for everybody," Goldman said.
Google had argued that software should only be allowed to be patented, not copyrighted. However, O'Malley wrote that the Federal Circuit is bound to respect copyright protection for software, "until either the Supreme Court or Congress tells us otherwise."
Oracle General Counsel Dorian Daley called the decision a "win" for an industry "that relies on copyright protection to fuel innovation." Google said it set a "damaging precedent for computer science and software development" and was considering its options.
The case in the U.S. Court of Appeals for the Federal Circuit is Oracle America Inc vs. Google Inc, 13-1021.