Germany's data centres hold untold terabytes of telecoms information
Vast amounts of telephone and e-mail data held in Germany must be deleted, the country's highest court has ruled.
The constitutional court overturned a 2008 law requiring communications data to be kept for six months.
The law - designed to combat terrorism and serious crime - required telecoms companies to keep logs of calls, faxes, SMS messages, e-mails and internet use.
But nearly 35,000 Germans lodged complaints against it, arguing that the law violated their right to privacy.
Responding to the thousands of formal complaints, Germany's constitutional court described the law as a "particularly serious infringement of privacy in telecommunications".
However, it did not rule against data retention in principle.
The judgement was handed down even though the law specified that companies were not supposed to record telephone calls or to read any of the e-mail or SMS communications.
But the records would include evidence of who got in touch with whom, for how long and how often - without requiring any evidence of wrongdoing.
The BBC's Oana Lungescu, in Berlin, says that the ruling did not overturn the European Union anti-terrorism directive on which the law is based, but may lead to its reassessment later this year.
Having been spied on for decades, first by the Nazis and then by the Stasi, the notorious communist secret police, Germans take their privacy seriously, our correspondent says.
The country's minister for consumer rights recently criticised Google's Street View project and urged people to object to the publication of pictures of their homes on the internet, which many did.