The court upheld Spanish telecom company Telefonica SA's right to refuse to hand over information that would identify who had used peer-to-peer file-sharing tool KaZaA to distribute copyrighted material owned by Promusicae, a Spanish nonprofit group of film and music producers.
EU law did not require governments to protect copyright by forcing companies to disclose personal data in civil legal actions, the Luxembourg-based court ruled.
They could draft national rules to change this but they will then have to balance the right to privacy against property rights and "cannot however affect the requirements of the protection of personal data," a court statement said.
The ruling "raises the question of the need to reconcile the requirements of the protection of different fundamental rights, namely the right to respect for private life on the one hand and the rights to protection of property and to an effective remedy on the other," the court said.
A Spanish court had asked the European court to give guidance on the case after Promusicae complained of Telefonica's refusal to hand over details identifying the people who used the computer addresses linked to the illegal downloads.
Telefonica claimed Spanish law only allows them to share personal data for criminal prosecutions or matters of public security and national defense.
Music industry group, the International Federation of the Phonographic Industry, said record labels would push on with their campaign against Internet piracy and the court had confirmed the need to have effective tools to tackle illegal copying.
"Copyright theft on the internet is the single biggest obstacle to the growth of the music business today," said IFPI head John Kennedy.
"The judgment means that music rights owners can still take civil actions to enforce their rights, and it has sent out a clear signal that member states have to get the right balance between privacy and enforcement of intellectual property rights and that intellectual property rights can neither be ignored nor neglected."
The European branch of the Motion Picture Association — which represents American film studios such as Universal, Walt Disney, Paramount and others — welcomed the ruling as balanced because the court had upheld copyright as a fundamental right alongside the right to privacy.
The MPA of America claimed in a 2005 study that U.S. film industry lost $6.1 billion to piracy worldwide that year, most of it outside the United States.
Millions of people use file sharing sites to download both legal and illegal copies of albums, films, TV episodes, computer programs and even books.
The music industry has largely shunned file sharing, preferring digital tools to restrict how songs can be copied and played.