Viacom, which owns MTV and Paramount Pictures, had brought a lawsuit against the video-sharing website, claiming that the site was guilty of copyright infringement.
The case, initiated in March 2007, centres on a claim by Viacom that their copyrighted videos had been viewed over 1.5 billion times on the site.
Thousands, possibly millions of videos featuring the music of record label-signed bands have been uploaded to the site.
YouTube has now been ordered to supply Viacom with details of all its users and their viewing habits.
This will include usernames, IP addresses and video clip details, effectively allowing Viacom to track all those who have viewed the copyrighted videos.
The case is expected to set a precedent for future court cases concerning YouTube, and possibly all those involving intellectual copyright issues.
With many music videos appearing on YouTube without permission from copyright holders, the ruling could have a significant impact on music fans.
The news follows Virgin Media’s announcement that it recently sent letters to 800 broadband subscribers suspected to have downloaded music illegally.