The "general and indiscriminate" retention of emails and other electronic communications data by national governments is illegal, the European Court of Justice has ruled.
The court found that only targeted retention aimed at fighting serious crime could justify such serious interference by the state.
The ruling came in response to a challenge brought by Labour deputy leader Tom Watson – originally with the backing of Tory MP David Davis before he became Brexit Secretary - to the UK Government's Data Retention and Investigatory Powers Act, which requires communications companies to retain data for a year.
Mr Watson said: "This ruling shows it's counter-productive to rush new laws through Parliament without a proper scrutiny.
"At a time when we face a real and ever-present terrorist threat, the security forces may require access to personal information none of us would normally hand over.
"That's why it's absolutely vital that proper safeguards are put in place to ensure this power is not abused, as it has been in the recent past.
"Most of us can accept that our privacy may occasionally be compromised in the interests of keeping us safe, but no one would consent to giving the police or the government the power to arbitrarily seize our phone records or emails to use as they see fit.
"It's for judges, not ministers, to oversee these powers. I'm pleased the court has upheld the earlier decision of the UK courts."
In its ruling the court said communications data enabled "very precise conclusions" to be drawn about the private lives of individuals and that national legislation requiring its retention had to be considered "particularly serious".
"The fact that the data is retained without the users of electronic communications services being informed of the fact is likely to cause the persons concerned to feel that their private lives are the subject of constant surveillance," it said.
"Consequently, only the objective of fighting serious crime is capable of justifying such interference. "
Legislation which provided for the "general and indiscriminate" retention of data "exceeds the limits of what is strictly necessary and cannot be considered to be justified within a democratic society," it said.