A federal judge handed Google Inc. a major victory Wednesday by rebuffing media company Viacom Inc.’s attempt to collect more than $1 billion in damages for the alleged copyright abuses of Google’s popular YouTube service.

The ruling by U.S. District Judge Louis Stanton in New York embraces Google’s interpretation of a 12-year-old law that shields Internet services from claims of copyright infringement as long as they promptly remove illegal content when notified of a violation.