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."
Nintendo sales double and profits balloon by 500 per cent as Shuntaro Furukawa is appointed president
Switch console sold more than 15 million units, while SNES Classic sold more than five million
High-precision measurements of nearly 1.7 billion stars made by Gaia space observatory
Water trapped in asteroids could be the source of the Earth's seas
Latest Skip Ahead build focuses on mobile and a number of small fixes