Emergency surveillance law rushed through parliament last year has been deemed unlawful by the UK High Court.
The court found that sections 1 and 2 of the Data Retention and Investigatory Powers Act 2014 (DRIPA) are incompatible with EU human rights legislation.
The law, which gained Royal Assent on 17 July last year, allows the UK home secretary to order companies to retain communications data for up to 12 months.
This data includes emails, texts, phone records and even communications from journalists, MPs, doctors and lawyers that may be considered confidential or privileged.
Judges ruled that the government will have until March 2016 to amend the legislation, after which the unlawful sections will cease to have effect.
Government have nine months to bring back new legislation. MPs were given one day to discuss the legislation last year.— tom_watson (@tom_watson) July 17, 2015
James Welch, legal director for Liberty, has claimed public dissent against surveillance law is growing and called for "fundamental reform" of the UK spying apparatus.
"Campaigners, MPs across the political spectrum, the government's own reviewer of terrorism legislation are all calling for judicial oversight and clearer safeguards," he said.
"The High Court has now added its voice, ruling key provisions of DRIPA unlawful. Now is the time for the home secretary to commit publicly to surveillance conducted with proper respect for privacy, democracy and the rule of law - not plough on with more of the same," he added after the ruling.
Labour MP Tom Watson has called for a proper framework and surveillance law oversight to be established.
"The government gave MPs one day to discuss the legislation, which was wrongly represented as respectful of people's right to privacy," he said.
Meanwhile, Conservative MP David Davis welcomed the ruling of the High Court.
"The court has recognised what was clear to many last year, that the government's hasty and ill-thought through legislation is fatally flawed," he said.
"They will now have to rewrite the law to require judicial or independent approval before accessing innocent people's data, reflecting the new consensus amongst experts in the Anderson and RUSI reports."
Cotton seedling freezes to death as Chang'e-4 shuts down for the Moon's 14-day lunar night
Fortnite easily out-earns PUBG, Assassin's Creed Odyssey and Red Dead Redemption 2 in 2018
Meteor showers as a service will be visible for about 100 kilometres in all directions
Saturn's rings only formed in the past 100 million years, suggests analysis of Cassini space probe data
New findings contradict conventional belief that Saturn's rings were formed along with the planet about 4.5 billion years ago