Google has won perhaps the most important court case it has ever fought – one that could have cost £6 billion and challenged the most central principles of software development.

If Google had lost the case it could have caused huge problems for the world’s most popular mobile operating system – as well as the rest of the technology industry.

A jury has found that Google didn’t need permission to use tools that were central to the development of Android. That means it avoids a potential £6 billion fine but perhaps more importantly lets it win a case that many had worried could threaten some of the core principles of software development.

The fallout revolved around the use of Java, a programming language. Oracle, which owns Java, argued that Google had stolen its intellectual property to build Android, now the world’s most popular mobile operating system.

But the US District Court jury found that Google had made “fair use”, under copyright law, of the Java elements that allow different pieces of the software to talk together.

Oracle, which had sought 9 billion dollars (£6.1 billion) in damages, immediately said it would appeal.

The verdict was closely watched in Silicon Valley, in part because many popular features of today’s smartphones only work because apps can “talk” to one another or the phone’s underlying software.

Google’s supporters – a group that included other tech firms, trade associations and the Electronic Frontier Foundation, an Internet rights group – warned that an Oracle victory would hamper future innovation by making software co-operation more difficult and expensive.

The high-profile dispute was a clash of Silicon Valley titans. While much of the trial focused on arcane aspects of computer programming, jurors heard testimony from prominent tech executives and two multi-billionaire moguls. Google co-founder Larry Page testified in person, while Oracle co-founder Larry Ellison appeared on video.

The jury’s verdict marks Google’s second victory in the case. US Judge William Alsup sided with Google in 2012, ruling that the APIs were not protected by copyright. An appellate court overturned the ruling and sent the case back for a second trial.

Oracle said it will appeal against the latest verdict on “numerous grounds”.

Oracle general counsel Dorian Daley said: “We strongly believe that Google developed Android by illegally copying core Java technology to rush into the mobile device market.”

Google welcomed the jury’s finding.

“Today’s verdict that Android makes fair use of Java APIs represents a win for the Android ecosystem, for the Java programming community, and for software developers who rely on open and free programming languages to build innovative consumer products,” the company said.