Nearly 35,000 Germans had appealed to the court to overturn the law that stemmed from a Europe-wide data retention plan formed under the UK's EU Presidency term. Just the previous year, London had been the target of several terrorist attacks.
"The disputed instructions neither provided a sufficient level of data security, nor sufficiently limited the possible uses of the data," the court said, adding that "such retention represents an especially grave intrusion."
Interior Minister Thomas de Maiziere, the country's top security figure, expressed disappointment at the court's decision. "It would be inappropriate to criticize a ruling by the constitutional court, but I have to say that it does not instill happiness," he told reporters.