Google has settled a landmark copyright lawsuit in which Viacom accused the Internet search company of posting its programmes on the YouTube video service without permission.

It ends years of litigation that drew attention from Hollywood, the music industry and Internet companies, and which tested a law designed to thwart piracy while letting people find entertainment online.

"This settlement reflects the growing collaborative dialogue between our two companies on important opportunities, and we look forward to working more closely together," Google and Viacom said in a joint statement.

Terms were not disclosed. 

No money changed hands, a person close to the matter said. The person was not authorised to discuss the settlement's terms.

Viacom had originally filed a $1 billion lawsuit against YouTube and others in 2007, and eventually accused the Google unit of illegally broadcasting 79,000 copyrighted videos on its website between 2005 and 2008.

Based in New York, Viacom is controlled by media mogul Sumner Redstone, and owns cable networks such as Comedy Central, MTV and Nickelodeon as well as the Paramount movie studio.

Google is based in Mountain View, California. It paid about$1.65 billion for YouTube in 2006.

Tuesday's settlement was announced 11 months after US District Judge Louis Stanton in Manhattan rejected Viacom's damages claims over YouTube's alleged posting of clips from 'The Daily Show with Jon Stewart,' 'South Park,' 'SpongeBob SquarePants' and other programs that viewers had uploaded.

Stanton concluded that YouTube did not have to constantly scour its website for infringing videos, so long as it removed such videos after receiving demands from copyright owners.

Viacom had been appealing that decision to the 2nd US Circuit Court of Appeals in New York, and oral argument had been scheduled for March 24.

"Content providers and service providers are finding it more constructive to work together rather than litigate," said June Besek, a Columbia Law School lecturer and intellectual property specialist. "Content providers need a Google to filter material, and Google needs content to attract people to its websites."

In April 2012, Google announced a licensing agreement with Paramount to bring nearly 500 movie titles such as "The Godfather" trilogy and "Ferris Bueller's Day Off" to YouTube and Google Play in the United States and Canada.

The case tested the reach of the federal Digital Millennium Copyright Act, a 1998 law that made it illegal to produce technology to circumvent anti-piracy measures, but limited liability of online service providers for copyright infringement by users.

In his April 2013 ruling, Stanton had concluded that Google and YouTube were protected from Viacom's copyright claims by "safe harbour" provisions in the law.

The judge rejected what he called Viacom's "ingenious" yet "extravagant" argument that YouTube should monitor the content of videos being uploaded at a rate of more than 24 hours of viewing time per minute.

He also said YouTube did not interact so closely with people uploading content that it could be said to have engaged in infringing activity.

Stanton had in 2010 also ruled for YouTube. The 2nd Circuit revived Viacom's case in April 2012, saying a reasonable jury could find that YouTube was aware of specific infringements.

Supporters of Viacom during the battle have included the Associated Press, Gannett Co, the Motion Picture Association of America, the National Football League, the Screen Actors Guild, Garth Brooks, the Eagles and Sting.

Google and YouTube won backing from eBay, Facebook, Tumblr, Yahoo, Consumers Union, Human Rights Watch and others.