THE UK Government has been called on to make urgent changes to the so-called “snoopers’ charter” after the European Court of Justice ruled today that "general and indiscriminate" retention of emails and other electronic communications data by national governments was illegal.

The court found that only targeted retention aimed at fighting serious crime could justify such serious interference by the state.

Opposition politicians and campaigners have now called on Prime Minister Theresa May to amend the Conservative Government’s controversial Investigatory Powers Act, dubbed the “snoopers’ charter,” which requires communications companies to retain data for a year. But the Home Office made clear it would seek to defend the data law robustly at the Court of Appeal.

The ECJ ruling came in response to a challenge to UK legislation brought by Labour deputy leader Tom Watson and, originally, with the backing of Tory MP David Davis before he became Brexit Secretary.

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,” he added.

Joanna Cherry QC, the SNP’s home affairs spokeswoman, said : "This decision of the European Court of Justice vindicates the stance which the SNP took against the indiscriminate collection of data authorised by the Investigatory Powers Act. The UK Govt must now heed our concerns and amend the Act to make it lawful."

Lord Paddick, the Liberal Democrat’s home affairs spokesman, said the ruling proved the UK Government had overstepped the mark and the legality of the Investigatory Powers Act had now been called into question.

Describing the collection and storage of everyone's internet web browsing histories and phone records to enable government agencies to look at them as an “Orwellian nightmare,” he added: "This dreadful piece of legislation will cost millions to implement and unless the Government reconsider, they will inevitably face further embarrassment in the courts."

The Home Office said it was disappointed by the ECJ ruling and would be considering its implications.

"It will now be for the Court of Appeal to determine the case. The Government will be putting forward robust arguments to the Court of Appeal about the strength of our existing regime for communications data retention and access,” explained a spokesman.

"Given the importance of communications data to preventing and detecting crime, we will ensure plans are in place so that the police and other public authorities can continue to acquire such data in a way that is consistent with EU law and our obligation to protect the public," he added.

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" exceeded the limits of what was strictly necessary and could not be considered to be justified within a democratic society," it said.

The Data Retention and Investigatory Powers Act, which was passed by the Lib-Con Coalition Government in 2014, expires at end of the year but has since been superseded by the expanded Investigatory Powers Act.

The civil rights group Liberty, which supported Mr Watson's challenge, said the Government would be forced to amend the law as a result of the ECJ ruling.

"Today's judgement upholds the rights of ordinary British people not to have their personal lives spied on without good reason or an independent warrant," said Liberty director Martha Spurrier.

"The Government must now make urgent changes to the Investigatory Powers Act to comply with this

"This is the first serious post-referendum test for our Government's commitment to protecting human rights and the rule of law. The UK may have voted to leave the EU - but we didn't vote to abandon our rights and freedoms,” it added.

The former head of MI5, Lord Evans of Weardale, said it was important that a sustainable, long-term solution was found so that data retention powers could be exercised "accountably and flexibly".

"The direct impact on the intelligence agencies may be limited as the EU does not have responsibility for national security," he said.

"But the intelligence agencies work very closely with colleagues in the police and anything that impacts on their operational effectiveness would be a concern and could leave us more vulnerable to attacks such as those we have seen only too frequently in recent months elsewhere in Europe, including that in Berlin," he added.

The case was originally referred to the judges in Luxembourg by the Court of Appeal and this court will now consider how the ruling will be applied.