After two years of legal wrangling, Google has done a deal with some of the world's biggest publishers and authors.

The copyright agreement with The Authors Guild and the Association of American Publishers (AAP) is being lauded as a landmark settlement.

For US web surfers, it will mean access to millions of in-copyright books as well as other written materials via Google Book Search, where individuals and institutions will be able to buy eBooks.

There will also be free access from US public libraries.

Said Sergey Brin, co-founder and president of technology at Google: "Google's mission is to organise the world's information and make it universally accessible and useful.

"Today, together with the authors, publishers, and libraries, we have been able to make a great leap in this endeavour. While this agreement is a real win-win for all of us, the real victors are all the readers. The tremendous wealth of knowledge that lies within the books of the world will now be at their fingertips."

But the deal is also landmark as it resolves a class-action lawsuit brought by book authors and the Authors Guild against Google, as well as a separate lawsuit filed by five large publishers as representatives of the AAP’s membership.

The class action is now subject to approval by the U.S. District Court for the Southern District of New York.

This deal protects authors and publishers' copyright and allows them to control how their intellectual property is accessed online and enables them to receive compensation for online access to their works.

Under the agreement, Google will make payments totaling $125 million, which will be used to create a Book Rights Registry, to resolve existing claims by authors and publishers and to cover legal fees.