The European Union’s top court has struck down a regional law that required telecom companies to store customer phone data for up to two years. The EU Data Retention Directive, which became law in March 2006, was declared as “invalid” by the European Court of Justice.

“The Court takes the view that by requiring the retention of those data and by allowing the competent national authorities to access those data, the directive interferes in a particularly serious manner with the fundamental rights to respect for private life and to the protection of personal data,” the court said in a press release. “Furthermore, the fact that data are retained and subsequently used without the subscriber or registered user being informed is likely to generate in the persons concerned a feeling that their private lives are the subject of constant surveillance.”

The proceedings were the result of complaints lodged by the High Court of Ireland and the Constitutional Court of Austria. In the ruling, the court questioned many aspects of the law such as the data retention period, which has a prescribed length of at least six months, and the broad coverage of the directive.

The ECJ also expressed concern over the lack of protection for citizens under the law, saying there were not enough safeguards to prevent abuse or ensure that data is destroyed at the end of the retention period.

The decision mirrors a district court judge’s ruling last December that declared NSA surveillance as “likely unconstitutional” and in violation of the Constitution’s provisions against unreasonable searches. However, the NSA case has yet to be heard in the Supreme Court. Yesterday, the high court said that it would not hold proceedings on the matter until the case goes through the appeals process.