They concluded that the mass trawling for information by Britain's GCHQ spy agency violated Article 8 of the European Convention on Human Rights regarding the right to privacy because there was "insufficient oversight" of the programme.
The court's seven judges also voted 6-1 that Britain's regime for getting data from communications service providers also violated the human rights convention, including its provisions on privacy and on freedom of expression.
It comes after USA whistleblower Edward Snowden disclosed British surveillance and intelligence-sharing practices.
A mass surveillance programme by the United Kingdom government violated human rights, the European Court has ruled.
However, the court said the sharing of information with foreign government was not in breach of the rules.
It is the first time the court has considered these United Kingdom regimes, and the first time it has ever considered intelligence-sharing programmes. They centred on complaints about powers given to security services under the Regulation of Investigatory Powers Act 2000 (RIPA) - which was later replaced with the Investigatory Powers Act (IPA) in November 2016.
"The Court has put down a marker that the United Kingdom government does not have a free hand with the public's communications and that in several key respects the UK's laws and surveillance practices have failed", said Dan Carey of Deighton Pierce Glynn solicitors, which acted for some of the parties.
The court's ruling doesn't mean all bulk data interception by European countries is automatically illegal.
The court said the system governing the bulk interception of communications was "incapable" of keeping interference to what is "necessary in a democratic society" for two reasons.
Bishop Michael Bransfield resigns; sexual harassment investigation launched
The investigation and resignation were announced on the same day that Francis is meeting with a delegation of U.S. Francis removed McCarrick as a cardinal in July after a US church investigation found the allegation credible.
Furthermore, it found the United Kingdom "was not in accordance with the law" over it's obtaining of communications data from service providers.
'Furthermore, there were no real safeguards applicable to the selection of related communications data for examination, even though this data could reveal a great deal about a person's habits and contacts, ' the court statement said.
In their ruling, judges declared there was insufficient monitoring of what information was being collected and that some safeguards were "inadequate".
Among the more than one dozen groups that took the case to Strasbourg were the London-based Big Brother Watch organisation, the Bureau of Investigative Journalism and former Guardian reporter Alice Ross.
The court did rule that a bulk operation on its own does not break the convention, but said that such a regime "had to respect criteria set down in its case law".
"An Investigatory Powers Commissioner has also been created to ensure robust independent oversight of how these powers are used".
Britain has changed its surveillance laws since the legal challenge began, passing new legislation that the government says has more privacy safeguards.
"Under the guise of counter-terrorism, the United Kingdom has adopted the most authoritarian surveillance regime of any Western state, corroding democracy itself and the rights of the British public", said Silkie Carlo, director of Big Brother Watch.