Google has reached a landmark agreement with authors and publishers to make millions of books available online, in a deal that includes a $125m (£80m) payout and the end to lawsuits filed by companies including Penguin.

The agreement, part of which is subject to the approval of the US District Court in New York, comes after two years of negotiations between the parties and will mark the end of two lawsuits against the Google Book Search tool.

Today's agreement settles a class action lawsuit filed by the Authors Guild in September 2005 challenging Google's plans to digitise, search and show snippets of in-copyright books and to share digital copies with libraries without explicit permission.

A month later five major members of the Association of American Publishers – McGraw-Hill, Pearson Education, Penguin, Simon & Schuster and John Wiley – filed a separate suit on similar grounds.

The deal today, described in a joint statement by all parties as "groundbreaking", will see online access granted for millions of in-copyright materials "and other written materials" in the US through Google Book Search.

Rights holders will be able to control the pricing of online content and access to books.

Under the agreement Google will make payments totalling $125m to be used to establish a Books Rights Registry, to resolve existing claims by authors and publishers and to cover legal fees.

Worldwide holders of US copyrights for written material can register works with the Books Rights Registry and receive compensation from subscriptions from institutions such as universities, book sales, ad revenue "and other possible revenue models", as well as cash payment for their works that have already been digitised.

Sergey Brin, co-founder of Google, called the deal a "great leap" in the search engine giant's endeavour to "organise the world's information".

Free access will also be made available at participating US libraries that are willing to pay a fee. There are more than 16,000 libraries in the US.

Libraries at the California, Michigan, Wisconsin and Stanford universities have "provided input" towards the settlement and will make their collections available.

"It is hard work writing a book and even harder work getting paid for it," said Roy Blount Jr, the president of the Authors Guild. "As an author, well, we appreciate payment when people use our work. This makes good sense."

· To contact the MediaGuardian news desk email editor@mediatheguardian.com or phone 020 7239 9857. For all other inquiries please call the main Guardian switchboard on 020 7278 2332.

· If you are writing a comment for publication, please mark clearly "for publication".