The European Union's Data Retention Directive has a sound legal basis because it connects to policing but does not actually cover policing functions, the European Court of Justice (ECJ) has said.
Ireland and Slovakia had objected to the Directive, which orders countries to pass laws requiring telecoms companies to retain phone and internet usage records for between six and 24 months so that they can be used to help solve crime.
Ireland and Slovakia took legal action to repeal the Directive because it was introduced by mechanisms reserved for economic laws and not through the processes reserved for laws relating to policing and justice.
The ECJ has said, though, that the Directive does regulate economic activity and not policing activity, and so was legally introduced and will stand.
"The provisions of [the Directive] are designed to harmonise national laws on the obligation to retain data (Article 3), the categories of data to be retained (Article 5), the periods of retention of data (Article 6), data protection and data security (Article 7) and the conditions for data storage (Article 8)," said the ECJ's ruling
"The measures provided for by [the Directive] do not, in themselves, involve intervention by the police or law-enforcement authorities of the Member States," it said. "[The Directive] thus regulates operations which are independent of the implementation of any police and judicial cooperation in criminal matters."
The ECJ found that EU member states had begun to pass their own, differing laws on the retention of telecoms data, and that this threatened EU economic integration.
"It was entirely foreseeable that the Member States which did not yet have rules on data retention would introduce rules in that area which were likely to accentuate even further the differences between the various existing national measures," it said.
"The differences between the various national rules adopted on the retention of data relating to electronic communications were liable to have a direct impact on the functioning of the internal market and that it was foreseeable that that impact would become more serious with the passage of time," said the ruling.
The Directive was found to have a sound legal basis.
The ECJ has followed the main arguments of its Advocate General, Yves Bot, who produced an opinion last October backing the legality of the Directive.
Civil liberties groups submitted documents to the Court on their concerns that it violates citizens' privacy rights, but the ruling did not deal with those concerns.
One of those groups, Digital Rights Ireland, said that it would continue to pursue a separate case which questions the legality of the Directive on privacy, not procedural, grounds.
"Our case is before the [Irish] High Court which is currently considering our application to refer these human rights issues to the European Court of Justice," said Digital Rights Ireland chairman TJ McIntyre. "After today's decision, our case is now all the more important and will continue. We are confident that the European Court of Justice will strike down the Directive when it comes to consider how it invades the right to privacy."
Today's judgment focused on a narrow point: the choice of legal basis. The court acknowledged that its ruling did not address "any possible infringement by the Directive of fundamental rights resulting from interference with the exercise of the right to privacy."