The court also concluded that both the bulk interception and communications data regimes provided insufficient safeguards in relation to confidential journalistic material.
The ECtHR found, by five votes to two, that the bulk interception regime violated Article 8 of the European Convention on Human Rights, which covers citizens' rights to have their private life and communications respected. The scope for unrestricted snooping "could be capable of painting an intimate picture of a person" through mapping of social networks and communication patterns, browsing and location tracking, and understanding who a person is interacting with, the court said.
It also ruled that the regime covering how the spy agency obtained data from internet and phone companies was "not in accordance with the law". Of greatest concern, however, is the absence of robust independent oversight of the selectors and search criteria used to filter intercepted communications (para 346-347).
Europe's human rights court is about to publish what could be a landmark ruling on the legality of mass surveillance.
The court gave Britain, which is in the process of altering legislation on an issue publicly exposed by USA whistle-blower Edward Snowden, three months to decide whether to request an appeal hearing after Thursday's ruling.
Snowden also revealed that the Government was accessing communications and data collected by the USA's National Security Agency and other countries' intelligence agencies.
Snowden leaked thousands of classified documents to the press in 2013 which revealed the vast scope of surveillance of private data that was put in place after the 9/11 attacks.
The judgement said the system revealed by Mr Snowden simply did not have any proper safeguards because it led to completely "untargeted" collection of information.
Specifically, the court said there wasn't enough independent scrutiny of processes used by British intelligence services to sift through data and communications intercepted in bulk.
A British government spokesperson said the government would "give careful consideration to the court's findings" while noting that a new "double lock" oversight mechanism on spying had been enacted in 2016 - three years after the spying revelations first emerged.
As the European Union legal order is integrated into that of the United Kingdom and has primacy where there is a conflict with domestic law, the Government had conceded in a recent domestic case that a very similar scheme introduced by the Investigatory Powers Act 2016 was incompatible with fundamental rights in European Union law because it did not include these safeguards. "This judgement is a vital step towards protecting millions of law-abiding citizens from unjustified intrusion".
The ECtHR found that similar faults to those found by the High Court in relation to part four of the Investigatory Powers Act were also present in RIPA.
But that argument doesn't convince critics of the Investigatory Powers Act - legislation which those opposed to it have previous labelled as "the most extreme surveillance law ever passed in a democracy".