The Google logo is displayed outside the company offices in New York, US, June 4, 2019. [Photo/Agencies]

It took 10 years to resolve and billions of dollars in a legal war, but the US Supreme Court decided Monday that Google’s lifting of about 11,500 lines of code from Oracle’s widely adopted Java software suite to run Android on most of the world’s smartphones was fair use and didn’t break copyright law.

The 6-to-2 ruling in what Google had called “the copyright case of the decade” spared the company claims from Oracle for $9 billion in damages.

Oracle, which acquired Java in 2010 when it bought Sun Microsystems, said that using parts of Java without permission amounted to copyright infringement.

Google responded that free access to the software interfaces in question were crucial to the innovation economy. The company argued that it had simply copied a “method of operation” in order to let Android interface with Java, representing about 0.4 percent of the code in the specific system at issue.

Justice Stephen G. Breyer, writing for the majority, said that Google was protected by the “fair use” exception to copyright protections. Google did not violate the copyright law, Breyer wrote.

Justice Clarence Thomas, in dissent, said the court’s generous fair-use analysis in Google’s favor “is wholly inconsistent with the substantial protection Congress gave to computer code”.

Thomas said that Oracle had a case in part because Amazon paid Oracle to license Java for its Kindle devices before Google’s use of the technology in Android.

“Google “erased 97.5% of the value of Oracle’s partnership with Amazon, made tens of billions of dollars, and established its position as the owner of the largest mobile operating system in the world. Despite this, the majority holds that this copying was fair use,” Thomas wrote.

In a statement after the ruling, Oracle said Google “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.”

Justice Amy Coney Barrett didn’t participate in the case, which was argued before she joined the court.

The courts’ decision was hailed by open-source software advocates as a victory for the ability of smaller competitors to build on widely used code instead of starting from nothing.

A judgement in Oracle’s favor also could have disrupted the whole computer industry, analysts said, because many commonly used systems are built on top of other companies’ code in a similar manner.

“The fair-use analysis is really going to set a precedent that’s going to shape serious case law for many, many years to come,” Corynne McSherry, legal director at the Electronic Frontier Foundation, which filed an amicus brief on Google’s behalf, told Yahoo Finance.

An association of other tech companies, including Microsoft, also supported Google.

Kent Walker, Google’s chief legal officer and senior vice-president for global affairs, told The Wall Street Journal that the ruling provides legal certainty to the next generation of developers, whose new products and services would benefit consumers.

“Innovation happens by standing on each other’s shoulders, and that is what’s going on here,” Walker said. “These are tools we use every day, methods of operation in the everyday world. The idea of fair use is beneficial for everyone in the industry.”