Google has won a long-running lawsuit that had accused it of illegally plagiarising and uploading millions of digital books for an online library.

The US Circuit Judge Denny Chin supported Google’s statement that the scanning of over 20 million books, and offering online clips of text comply with US copyright law.

Chin said that the scanning will help students, teachers, researchers and the public to find books, while maintaining "respectful consideration" for authors’ rights.

Google said in a statement that this has been a long road and the company welcomes the latest judgment.

"As we have long said, Google Books is in compliance with copyright law and acts like a card catalog for the digital age," the search major said.

The latest victory is considered to be a major milestone for the battle between Google, the Authors Guild and US publishers, who initially sued Google in 2005 over its plans to establish a digital library.

Authors Guild executive director Paul Aiken said that the group is disappointed in the decision and plans to appeal.

"This case presents a fundamental challenge to copyright that merits review by a higher court," Aiken said.

"Google made unauthorised digital editions of nearly all of the world’s valuable copyright-protected literature and profits from displaying those works."

"Such mass digitisation and exploitation far exceeds the bounds of the fair use defence."

In April this year, the search engine firm had reportedly scanned over 30 million works that were ready to be added in its digital library.