The complaints before the ECHR focused on three different surveillance regimes: the bulk interception of communications [mass surveillance], intelligence sharing with foreign governments, and the obtaining of communications data from communications service providers.

In a five to two vote, the ECHR ruled there is "insufficient oversight" and "inadequate safeguards" over the bulk interception by GCHQ, the government’s communications agency, of its own citizens' records through its controversial "Tempora programme", first disclosed by NSA whistleblower Edward Snowden.

The mass spying scheme did "not meet the 'quality of law' requirement" and was "incapable of keeping the 'interference' to what is 'necessary in a democratic society'", the ECHR said.

In a separate six to one vote, the top EU court also convicted the U.K.'s regime for obtaining communications data from service providers "was not in accordance with the law", adding there were "insufficient safeguards" for journalistic material in the U.K. government's policy.

The ECHR noted that "safeguards were not sufficiently robust to provide adequate guarantees against abuse", and said it was particularly concerned that GCHQ can search and examine citizens' "related communications data" — such as location data and IP addresses — without restriction.

But the Strasbourg court said the GCHQ’s sharing of sensitive digital intelligence with foreign governments was not illegal, arguing that did not constitute a breach of rights.

The challenge combining three cases, with the action brought by a coalition of human rights groups and privacy organizations, including the American Civil Liberties Union, Amnesty International, Big Brother Watch, Liberty, Privacy International, and nine other human rights and journalism groups based in Europe, Africa, Asia, and the Americas.

They took the move after whistleblower Edward Snowden revealed mass surveillance by GCHQ and other agencies in 2013.