It's taken almost a decade, but the courts have finally handed down a ruling on Google's audacious project to scan millions of books to build a book search engine. The ruling is a decisive victory for Google, copyright's fair use doctrine  and online innovation.

When Google started work on its book search engine a decade ago, the company realized that getting the approval of copyright holders would be a logistical nightmare. Not only would major publishers likely demand high fees for permission to scan their books, but for many older works, it would be difficult to even figure out who the appropriate copyright holder was. So Google took a gamble, scanning library books without seeking copyright holders' permission and relying on copyright's fair use doctrine as a justification.

On Thursday, the gamble paid off, as Judge Denny Chin of the Southern District of New York handed Google a big victory. Chin praised the Google Books project for its many public benefits, and concluded that the project's transformative use of copyrighted books meant that the use of the books was legal under copyright's fair use doctrine.

Google was the natural candidate to pioneer this case because its search engine for the Web is based on a similar legal theory. Google Books performs the same service for books that its flagship search engine performs for the Web. Google's Web search engine depends on copyright's fair use doctrine, and Google believed the same legal principle would apply to the print world.

Not all authors agreed. In 2005, a coalition of authors and publishers launched a legal battle that has now stretched out to eight years. Chin rejected a proposal to use a class-action settlement to create a de facto Google Book monopoly in 2011, and the publishers settled with Google soon afterward. But the authors pressed on, and the court finally reached the legal merits of the case this week.

Fair use rulings focus on four factors. Of these, the most important is whether the use of the work is "transformative." Chin ruled that Google Books passes this test easily.

"Google Books digitizes books and transforms expressive text into a comprehensive word index that helps readers, scholars, researchers, and others find books," he wrote. "Google Books does not supersede or supplant books because it is not a tool to be used to read books."

Another factor weighing in Google's favor, in Chin's view, is that Google Books expands the market for books by helping consumers discover books they would not otherwise have known existed. He rejected authors' arguments that people could use the search engine to assemble copies of entire books out of the short "snippets" Google displays in search results. Chin noted that this was impossible because Google, anticipating this objection, deliberately excludes about 10 percent of the text in each book from being displayed in search results.

If the ruling is upheld on appeal, it will represent a significant triumph for Google. More important, it would expand fair use rights, benefiting many other technology companies. Many innovative media technologies involve aggregating or indexing copyrighted content. Today's ruling is the clearest statement yet that such projects fall on the right side of the fair use line.