The High Court has ruled that parts of the Investigatory Powers Act, dubbed the "Snoopers Charter", must be amended as it runs contrary to EU law.
Judges found that the Data Retention and Investigatory Powers Act (DRIPA), which the Snooper's Charter replaced and expanded upon last year, broke the law by allowing access to individuals' phone and internet records without the suspicion on criminal activity.
As such, parts of the Snooper's Charter are also unlawful.
The changes to DRIPA were passed by Parliament in March 2015 after the Press Gazette Save Our Sources campaign.
These brought in a requirement that police requests to view journalists' call records in order to identify sources of leaks be signed off by judges.
After pressure from media organisations, additional protections were included in the bill to protect journalistic sources.
The case, originally brought forward by Labour's Tom Watson in 2014, was also contested by judges to have empowered authorities to grab people's information without obtaining prior consent.
Martha Spurrier, director of human rights campaign group Liberty, which represented Watson in the case, told Factor magazine: "This judgement 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.
Liberty has said it will challenge a separate part of the bill that it claims authorises other "unprecedented" mass surveillance powers including hacking, spying on phone calls and emails on a "industrial scale".
It has raised crowdfunded over £50,000 to support their challenge.