By Nate Raymond and Blake Brittain

(Reuters) -A U.S. judge has ruled that an online library operated by the nonprofit organization Internet Archive infringed the copyrights of four major U.S. publishers by lending out digitally scanned copies of their books.

The ruling by U.S. District Judge John Koeltl in Manhattan on Friday came in a closely watched lawsuit that tested the ability of Internet Archive to lend out the works of writers and publishers protected by U.S. copyright laws.

The San Francisco-based non-profit over the past decade has scanned millions of print books and lent out the digital copies for free. While many are in the public domain, 3.6 million are protected by valid copyrights.

That includes 33,000 titles belonging to the four publishers, Lagardere SCA’s Hachette Book Group, News Corp’s HarperCollins Publishers, John Wiley & Sons Inc and Bertelsmann SE & Co’s Penguin Random House.

They sued in 2020 over 127 books, after Internet Archive expanded lending with the COVID-19 pandemic’s onset, when brick-and-mortar libraries were forced to close, by lifting limits on how many people could borrow a book at a time.

The nonprofit, which partners with traditional libraries, has since returned to what it calls “controlled digital lending”.

It currently hosts about 70,000 daily e-books “borrows”.

It argued its practices were protected by the doctrine of “fair use” which allows for the unlicensed use of others’ copyrighted works in some circumstances.

But Koeltl said there was nothing “transformative” about Internet Archive’s digital book copies that would warrant “fair use” protection, as its e-books merely replaced the authorized copies publishers themselves license to traditional libraries.

“Although IA has the right to lend print books it lawfully acquired, it does not have the right to scan those books and lend the digital copies en masse,” he wrote.

Internet Archive promised an appeal, saying the ruling “holds back access to information in the digital age, harming all readers, everywhere.”

Maria Pallante, the head of Association of American Publishers, in a statement said the ruling “underscored the importance of authors, publishers, and creative markets in a global society.”

(Reporting by Nate Raymond in Boston and Blake Brittain in Washington; editing by Michael Perry and Jason Neely)