The US Supreme Court on Monday handed Google a major win in a long-running copyright battle with Oracle, ruling that the use of the Java programming language for the Android mobile operating system was "fair use."

The 6-2 ruling had been closely watched as a key test of copyright in the digital era, and allows Google to avoid paying out billions to its technology rival.

Justice Stephen Breyer wrote in the 39-page majority opinion that even if Google used copyrightable material, "the copying here at issue nonetheless constituted a fair use. Hence, Google's copying did not violate the copyright law."

The case revolved around whether copyright protection should be extended to application software interfaces (APIs), the bits of code that allow programs and apps to work together, and if so, whether Google's implementation was a "fair use" of Oracle's copyrighted material.

The US Supreme Court ruled for Google in a landmark copyright case with enormous implications for the internet era
The US Supreme Court ruled for Google in a landmark copyright case with enormous implications for the internet era AFP / KIMIHIRO HOSHINO

The decade-old case drew interest across the spectrum of technology firms and creative industries, and sparked heated debate on how much copyright protection should be afforded to bits of computer code.

Two separate jury trials ended with a determination that Google's "software interface" did not unfairly use Java code, saving the internet giant from a possible multibillion-dollar verdict.

But an appeals court in 2018 disagreed, saying the software interface is entitled to copyright protection, prompting Google to take the case to the highest US court.

Oracle obtained the rights to Java in 2010 when it acquired Sun Microsystems -- which had supported Google's use of Java for Android -- and sought $9 billion in damages in its original complaint.

Supreme Court Justice Stephen Breyer wrote the majority opinion giving Google a victory in a major copyright battle with Oracle
Supreme Court Justice Stephen Breyer wrote the majority opinion giving Google a victory in a major copyright battle with Oracle GETTY IMAGES NORTH AMERICA / CHIP SOMODEVILLA

Google vice president Kent Walker called the ruling "a victory for consumers, interoperability, and computer science" adding in a statement: "The decision gives legal certainty to the next generation of developers whose new products and services will benefit consumers."

Oracle contended that the decision legitimizes a theft by Google that enabled its growth.

"The Google platform just got bigger and market power greater," Oracle general counsel Dorian Daley said.

The Supreme Court ruled 6-2 in favor of Google over Oracle in a case with major implications for copyright in the digital age
The Supreme Court ruled 6-2 in favor of Google over Oracle in a case with major implications for copyright in the digital age AFP / Eric BARADAT

"They stole Java and spent a decade litigating as only a monopolist can. This behavior is exactly why regulatory authorities around the world and in the United States are examining Google's business practices."

Google and many Silicon Valley allies have argued that extending copyright protection to APIs would threaten innovation in the fast-evolving digital world.

According to Google, a win for Oracle would have upended the longstanding expectation of software developers that they are free to use existing computer software interfaces.

Oracle backers said Google would walk away with "intellectual property theft" in the court victory, arguing that it would make it hard to protect any digital property from Chinese misappropriation.

In a dissent, Justice Clarence Thomas, joined by Justice Samuel Alito, wrote that the court should have taken a narrower view of copyright in view of Google's copying of 11,500 lines of code.

"The court wrongly sidesteps the principal question that we were asked to answer: Is declaring code protected by copyright? I would hold that it is. Computer code occupies a unique space in intellectual property," Thomas wrote.

Breyer wrote that new technologies call for a broader view.

"The fact that computer programs are primarily functional makes it difficult to apply traditional copyright concepts in that technological world."

Breyer wrote that Google "reimplemented a user interface, taking only what was needed to allow users to put their accrued talents to work in a new and transformative program."

Law professor Steven Vladeck of the University of Texas said on Twitter the ruling was "a win for Google," though he argued that "the big issue got punted" because the justices failed to decide on whether this type of software code may be copyrighted.

But Boston University law professor Tiffany Li called it a "huge win for fair use and people who understand how coding works!"

John Bergmayer of the consumer group Public Knowledge likewise said the court "came to the right decision," adding: "this opinion bolstering and supporting fair use is great news for consumers and advocates who believe that the technology sector needs more competition -- not more legal doctrines expressly designed to limit it."

Justice Amy Coney Barrett, who joined the court last year after oral arguments, did not participate in the case.