The ruling by the US Supreme Court relates to the internet giant's Android operating system, which is used on most smartphones worldwide.
The US Supreme Court delivered Google a significant victory on Monday after a long-running copyright dispute with Oracle, ruling that the use of the Java programming language for the Android operating system was "fair."
After a 6-2 decision in favor of Google, the judges reversed a lower court's ruling that deemed the search engine's inclusion of Oracle's software code unfair.
Justice Stephen Breyer said granting Oracle the right to enforce a copyright on its code would harm the public by making it a "lock limiting the future creativity of new programs. Oracle alone would hold the key."
Breyer wrote that, even if Google had 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 centered on whether copyright protection should be extended to application software interfaces (APIs), the parts of code that allow programs and apps to work together, and, if so, whether Google's implementation was a "fair use" of copyrighted material.
Previously, two separate trials determined that Google's "software interface" did not unfairly use Java code.
But an appeals court overturned that judgment in 2018, stating that the software interface is entitled to copyright protection, causing Google to move the case to the Supreme Court.
Oracle, which in 2010 acquired the rights to Java when it bought Sun Microsystems — which had supported Google's use of Java for Android — sought $9 billion (€7.62 billion) in damages as part of its original complaint.