Google reached a settlement Thursday with a book publishing group in a long-standing battle to create the world’s biggest digital library of books and journals.

The seven-year-old legal battle centered on whether Google was violating publishers’ copyrights by scanning and posting out-of-print books and journals online, making them searchable and readable through its Google Library project.

Google argued that it was providing a vital public service by allowing rare and out-of-print books to be instantly accessed by readers over the Internet. Publishers and authors argued that Google was illegally scanning their works without giving them proper compensation and control over the rights to their texts online.

Under the settlement, the publishers, which were represented by the Association of American Publishers, will be able to choose whether or not to make work that Google has already scanned available for the project. If they choose to make the material available, Google will provide a digital copy for the publisher’s personal use. If they choose not participate, Google will remove the material.

Going forward, publishers can negotiate directly with Google to allow additional material to be included in the database.

The financial terms of the settlement were not disclosed.

“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,” Google chief legal officer David Drummond said in a statement.

Five publishers were part of the suit: the McGraw-Hill Companies, Inc.; Pearson Education, Inc.; Penguin Group (USA) Inc.; John Wiley & Sons, Inc.; and Simon & Schuster, Inc.

Tom Allen, AAP president and chief executive, said in a statement he was “pleased” with the agreement.

“It shows that digital services can provide innovative means to discover content while still respecting the rights of copyright-holders,” Allen said.

The settlement does not affect Google’s ongoing legal battle with the Author’s Guild, which represents novelists and other book writers, over similar copyright concerns. New York-based U.S. Circuit Court Judge Denny Chin recently granted that group class action status to challenge Google’s project.

Chin previously rejected a proposed deal between Google and authors in 2011, saying the terms gave Google too great an advantage over copyright holders and other Google competitors.

The company recently settled with two groups representing French authors. Under that agreement, Google can post books online and French authors retain control over the commercial use of their material.