A US federal appeal court has overturned a ruling preventing Google's image-search displaying small versions of photos from an adult website.
Google has faced many complaints about linking to copyright material
Perfect 10, which publishes a pornographic magazine and website, launched its case against Google in November 2004.
It later added the Amazon.com site to its complaint.
Google said the thumbnail images were "fair use" and the court agreed they were "highly transformative" work.
The original ruling had said that Google's thumbnails could undermine Perfect 10's efforts to sell small images to mobile phone users.
"We are delighted that the court affirmed long-standing principles of fair use," said Google General Counsel Kent Walker.
"Google services respect intellectual property and help people around the world find what they're looking for," he added.
'Might be liable'
Perfect 10 also said that the thumbnail pictures on Google were helping users to find other websites that were using the full-sized images without permission.
On that claim, the court said: "There is no dispute that Google... assists a worldwide audience of users to access infringing materials."
It ruled that Google might be liable if it could have taken "simple measures to prevent further damage to Perfect 10's copyrighted works and failed to take such steps".
The case reflects the growing discrepancy between technological change and the legal system, in particular over copyright and fair use.