Key sections of the UK's mass surveillance regime may have to be changed after judges ruled Tuesday (30 January) a prior spy law rushed through parliament was unlawful.

The Court of Appeal backed a challenge from Labour MP Tom Watson first filed in 2014 which claimed that police and law enforcement authorities had too much power to snoop – without oversight – on data that had no relevance to investigating serious crime.

Judges agreed that the Data Retention and Investigatory Powers Act (DRIPA) breached the human rights of UK citizens because it let police and public bodies authorise their own access to information, while neglecting the use a court or independent body.

They said data was not restricted to use in serious criminal probes and was "inconsistent with EU law".

The decision means that sections of the Investigatory Powers Act are now "effectively unlawful" and should be urgently changed according to experts from human rights group Liberty, which helped facilitate the case.

DRIPA, an emergency spy law rushed through parliament with very little debate, helped to form the basis of the IPA, which many critics describe as a "Snoopers' Charter".

The new law, which is starting to take effect, forces communications and internet providers to store metadata of all emails, texts, phone calls and internet communications for 12 months.

"The act dramatically expanded powers to gather data on the entire population, while maintaining the lack of safeguards that resulted in this legal challenge," Liberty said.

In November last year, the UK's Home Office confirmed that changes to the IPA needed to be made. Its proposals were slammed by Watson at the time as "half-baked".

The action was initially co-signed by David Davis MP, yet despite once being a fierce critic of the law the politician bailed from the legal challenge in 2016 after becoming Brexit secretary.

"This legislation was flawed from the start," said Watson, responding to the ruling. "It was rushed through parliament just before recess without proper parliamentary scrutiny.

"The government must now bring forward changes to the Investigatory Powers Act to ensure that hundreds of thousands of people, many of whom are innocent victims or witnesses to crime, are protected by a system of independent approval for access to communications data. I'm proud to have played my part in safeguarding citizen's fundamental rights."

Martha Spurrier, Liberty's Director, commented: "Yet again a UK court has ruled the government's extreme mass surveillance regime unlawful.

"This judgment tells ministers in crystal clear terms that they are breaching the public's human rights. The latest incarnation of the Snoopers' Charter, the Investigatory Powers Act, must be changed. No politician is above the law. When will the government stop bartering with judges and start drawing up a surveillance law that upholds our democratic freedoms?"

The Home Office is yet to respond to the ruling.