A US appeals court ruled the use of Java code in the Android operating system infringed Oracle’s copyright, overturning the result of a 2016 judgement and potentially landing Google with a $9 billion bill.

The case, which has been rolling on for eight years, centres on whether Google’s use of Java software within Android fell within fair use guidelines. In 2016, a San Francisco court ruled it did, but the ruling was subsequently appealed by Oracle in early 2017.

Oracle EVP, general counsel and secretary Dorian Daley said the latest decision “upholds fundamental principles of copyright law and makes clear that Google violated the law,” and “protects creators and consumers from the unlawful abuse of their rights.”

The level of royalty payment owed is yet to be decided by authorities, but in its original case Oracle was seeking around $9 billion.

Oracle’s complaint dates back to 2010, when the company acquired several Java patents alongside software company Sun Microsystems and subsequently sued Google for using – what it claimed – was its intellectual property. Throughout the various hearings and appeals, Google maintained its use of Java code – which is integral to its Android operating system – fell under fair usage guidelines.

In a statement, Google said it was considering its options: “We are disappointed the court reversed the jury finding that Java is open and free for everyone. This type of ruling will make apps and online services more expensive for users.”