It took a multimillion dollar lawsuit, two years of tense negotiations, and an awful lot of scanning. But yesterday the publishing world stood on the threshold of a digital era after a US deal paved the way to transform publishing.

The agreement between Google and the US book industry means that internet users will soon be able to choose from and buy millions of titles, many out of print, or read them on a page-by-page basis.

The service invites comparison to the iTunes revolution, and was hailed by the internet search giant, the American Association of Publishers, and the Authors' Guild as a key moment in the evolution of electronic publishing.

Google's co-founder, Sergey Brin, called the $125m deal a "great leap". Paul Aiken, executive director of the guild, called it "the biggest book deal in US publishing history". Once approved by a federal court in Manhattan, the deal will offer access to a library of millions of titles.

After searching for books via Google, users will be offered free samples of chosen titles, with the option to buy more. Although it is as yet unclear how much books will cost to download, a royalty organisation, the Book Rights Registry, will take payments from Google (after it has taken a 37% cut) and distribute them to the authors and publishers. "This historic settlement is a win for everyone," said Richard Sarnoff, chairman of the publishers association. "It's hard work writing a book, and even harder work getting paid for it," said Roy Blount, president of the guild. "This deal makes good sense."

The agreement mirrors the way that Apple's iTunes music store helped revolutionise the record industry when launched in 2003. Although the Google scheme will start in the US, Google's chief legal officer, David Drummond, said that it was working with rights holders, governments and organisations in other countries.

To start with, the scheme will be targeted at universities and organisations which will pay large institutional subscriptions on behalf of students and researchers. But the deal also enables ordinary customers to download any of the 7m books already scanned into Google's database.

UK publishers hoped the deal will be replicated. Simon & Schuster UK's chief executive, Ian Chapman, said: "It's a significant agreement, but also has substance for the longer term - it's ground-breaking." Mark Le Fanu, of the Society of Authors, said: "What is so positive is that it recognises that authors and publishers must be involved when works in copyright are digitised and made available to the public, and usage must be paid for, while at the same time it promises to make the practicalities easily manageable for users." At The Bookseller, Neill Denny said the deal was good news, as it put more books in front of more people, and access ultimately created demand. "It's the long tail argument writ large, and I'm not only talking about books but also book content. If you want to read one chapter from an obscure textbook about Serbo-Croatian poetry in the 1920s, there might be five books on the subject, but 10 with chapters on the topic. This opens up the route to what you might describe as granulisation of book content ... tailored books. And for publishers it's a new revenue stream."

The deal, subject to court approval, ends a lawsuit by authors and publishers against Google Book Search after it began scanning US books still in copyright.

Backstory

Google began scanning and uploading books four years ago. However, unlike other countries where it scanned books fallen out of copyright, in America it scanned books that were simply out of print and made them available through its search engine - enraging publishers and authors. Three years ago, the Authors Guild, the Association of American Publishers and others filed a class action lawsuit against Google Book Search. As part of the agreement Google will compensate them at a minimum of $60 (£37) per work, costing it up to $90m of the $125m deal.