(CNN) -- Google announced it had won a major copyright-infringement case in Spain on Thursday, affirming that the Internet giant is not responsible for copyright violations when users post material on its YouTube website.
A federal court in Madrid, Spain, found that it is the responsibility of copyright owners -- not YouTube, or Google, which owns it -- to identify material that infringed copyright, Google said.
The ruling mirrors one in the United States earlier this year, when Google won a nasty three-year court battle with Viacom.
In the Spanish case, Spanish broadcaster Telecinco had claimed that YouTube should be liable when users upload copyright-infringing material, Google said on its European policy blog.
The court rejected Telecino's claim, Google said, calling the verdict "a clear victory for the internet and the rules that govern it."
Google said the ruling affirms existing European law.
Three months ago, a U.S. District Court in New York ruled YouTube is covered by a "safe harbor" clause in the Digital Millennium Copyright Act that protects service providers from penalties for their users' copyright violations, so long as they address those violations once they're made aware of them.
"The provider must know of the particular case before he can control it," Judge Louis Stanton said in the ruling in June. "The provider need not monitor or seek out facts indicating such activity."
The ruling follows a years-long battle over copyright infringement that has often featured heated arguments.
Viacom devoted an entire section of its online newsroom to chronicling the legal fight.
Viacom, the owner of MTV Networks and Paramount Pictures, maintained that Google bought YouTube knowing full well that the site was guilty of copyright infringement but turned a blind eye to users' violations.
The media company has said it believes Google should review content before it is posted, rather than waiting for copyright holders to request that Google remove illegal content.
Google welcomed the ruling on its blog.
"This is an important victory not just for us, but also for the billions of people around the world who use the web to communicate and share experiences with each other," Kent Walker, Google vice president and general council, said on the blog.
CNNMoney's Annalyn Censky contributed to this report.