Google and five publishers said Thursday they are settling one of its long-running legal flaps over the media giant's scanning of university library books without permission. The deal is a huge concession by Google, which up until now had maintained it had a fair-use right under copyright law and did not need permission from rights holders to scan the digital library of the future.

The case was being closely followed by the intellectual-property community, as it tested the limits of the fair-use defenses to copyright infringement.

"The settlement acknowledges the rights and interests of copyright-holders. U.S. publishers can choose to make available or choose to remove their books and journals digitized by Google for its Library Project," the companies said in a joint statement. Google scanned copyrighted works under the theory that indexing and displaying portions of copyrighted works counted as fair use, with no permission needed.

Other terms of the deal remain confidential. The deal was brokered with some of the biggest names in publishing, including: the McGraw-Hill Companies, Pearson Education, Penguin Group, John Wiley & Sons and Simon & Shuster.

The litigation began in 2005, a year after Google made a deal with several universities to scan millions of books in their libraries, without the rights holders' permission, and make "snippets" of those books available online via Google’s search engine. The Mountain View, California, search giant was subsequently sued by individual writers, publishers and the Authors Guild – litigation that has had a tortured history that resulted in a settlement a federal judge rejected last year.

But Thursday's deal, an about-face by Google because it had long insisted it had the fair-use right to scan and publish about 20 percent of the works without permission, does not end the litigation pending with the Author's Guild. That portion of the case – and how to deal with so-called orphaned books – is stalled on appeal.

Fair use is a defense to copyright infringement and may be invoked for purposes such as criticism, commentary, news reporting, teaching, scholarship or research.

In July, Google told the federal judge presiding over the case that "books exist to read" (.pdf) and that it does not need permission to copy the works, make them searchable or to provide brief snippets of them.

"Google made digital copies of books in order to create a searchable index linking each word found in any book to all books in which that word appears. That index provides a wealth of new information, allowing a user to find every book monitoring a particular topic or using a particular phrase together with up to three short snippets of text showing the context in which that term appears," Google wrote.

Andi Sporkin, a spokeswoman for the settling publishers, said the deal grants Google the rights to display up to 20 percent of the work, and also grants Google permission to sell the books and journals via Google Play, its online and Android-based marketplace. Other terms of the deal were not disclosed.

"In terms of coming to an agreement on what was fair use, it was an agreement to disagree," Sporkin said. "We were able to get beyond that and establish business terms. Did we come up with a universal definition of fair use? No."

David Drummond, a Google senior vice president, said in a statement: "By putting this litigation with the publishers behind us, we can stay focused on our core mission and work to increase the number of books available to educate, excite and entertain our users via Google Play."

Google declined further comment.

U.S. District Judge Denny Chin last year rejected a deal with the Author's Guild and Google that would have allowed Google to scan copyrighted books (including ones whose copyright owners could not be found), sell them on the internet and have them pop up in search results, while allowing up to 20 percent of the text to display in a search.

The rights holders would have gotten 67 percent of the take and Google the remainder. But when it came to millions of so-called orphaned works, Google's proposal went too far, Chin said. Under the deal, Google would also have been able to scan and sell titles whose rights holder could not be located, setting aside the proceeds if the author turned up later. In rejecting the deal for orphaned works, Chin said Congress, not he, should "establish a mechanism for exploiting unclaimed books."

Litigation between the guild and Google is stalled, as a federal appeals court weighs the judge's decision to certify the suit as a class action.