The European Union's top court ruled on Tuesday that national authorities cannot retain phone data in a "general and indiscriminate" manner, but could use specific information to tackle some very serious crime.
The court ruled on a case brought by the Supreme Court in Ireland where a man sentenced in 2015 to life imprisonment for murder appealed, saying the court of first instance had wrongly admitted traffic and location data of telephone calls as evidence.
The Luxembourg-based Court of Justice of the EU (ECJ) on Tuesday said it was up to a national court there to decide whether the evidence was allowed.
But it also said the bloc's members cannot have laws in place that would allow crime prevention through the "general and indiscriminate" retention of such data.
Some circumstances, such as particularly serious crime regarded as a threat to national security, could justify data retention but only in a narrower scope or for a limited time.
The ruling follows another from the ECJ last year that found such data could be used to "combat serious crime or prevent serious threats to public security".
(Writing by Gabriela Baczynska; editing by Barbara Lewis)