Google bought YouTube in 2006
Viacom has "backed off" from demands to divulge the viewing habits of every user who has ever watched a video on YouTube, the website has claimed.
Google had been ordered to provide personal details of millions of YouTube users to help Viacom prepare its case on alleged copyright infringement.
Google, owners of YouTube, will now hand over the database but without data that could identify users.
Viacom has a $1bn (£497m) copyright infringement lawsuit against Google.
A class action by other organisations including the English Premier League has also agreed to the new terms.
"We are pleased to report that Viacom, MTV and other litigants have backed off their original demand for all users' viewing histories and we will not be providing that information," said a statement on the YouTube blog.
The decision will be welcomed by privacy activists, many of whom expressed concern over a US judge's order for Google to provide the data in early July.
YouTube, which was bought by Google in 2006, is in battle with Viacom, which owns MTV and Paramount Pictures, over alleged copyright infringement.
Viacom alleges clips from its programmes have been viewed on YouTube without its consent.
When it initiated legal action in March 2007, it said it had identified about 160,000 unauthorised clips of its programmes on the website, which had been viewed more than 1.5 billion times.
Following the launch of its billion-dollar lawsuit, YouTube introduced filtering tools in an effort to prevent content that infringes copyright from appearing on the site.
Viacom had said it wanted the log data to "compare the attractiveness of allegedly infringing video with that of non-infringing videos".
But privacy activists argued in response that the original order "threatens to expose deeply private information" and was in breach of a 1988 Video Privacy Protection Act, which was passed after the rental habits of a Supreme Court nominee were publicised.
The new ruling means that Google will still have to hand over the data logs but in an "anonymized form", meaning YouTube can swap user logins and IP addresses with other random signifiers
An earlier Viacom request that Google be forced to hand over the source code of YouTube has already been denied by a US court on the grounds it is a "trade secret".
Despite Tuesday's agreement, the companies are yet to agree the process of information disclosure regarding viewing of YouTube clips by employees of YouTube and Google. This is expected to be settled in the coming weeks.
The cases are expected to come to trial in 2009 or 2010.