The United Kingdom’s top surveillance agency has acted unlawfully by keeping details about the scope of its Internet spying operations secret, a British court ruled in an unprecedented judgment issued on Friday.

Government Communications Headquarters, or GCHQ, was found to have breached human rights laws by concealing information about how it accesses surveillance data collected by its American counterpart, the National Security Agency.

The ruling was handed down by the Investigatory Powers Tribunal, a special court that handles complaints related to covert surveillance operations conducted by law enforcement and intelligence agencies. In its 15-year history, the tribunal has never before upheld a complaint against any intelligence agencies.

The legal challenge was brought by human rights groups, including Privacy International and Liberty, following disclosures from NSA whistleblower Edward Snowden. The groups alleged that GCHQ was unlawfully obtaining data through the NSA’s online spying program PRISM, which collects data stored by Internet giants such as Google, Apple, Microsoft, and Yahoo. The groups also focused on GCHQ’s role in obtaining private communications swept up by the NSA directly from internet cables, known as so-called “upstream” collection.

The court ruling against GCHQ found that by keeping the rules underpinning the surveillance secret, the agency had “contravened” the privacy and free expression provisions of the European Convention on Human Rights. The secret policies were released for the first time in December, meaning that until then GCHQ had been operating unlawfully, likely for several years. (GCHQ has had access to PRISM since at least 2010, according to reports based on Snowden documents.)

The judges cited a previous ruling that stated laws must be publicly available and clear enough so that individuals have “adequate protection against arbitrary interference.” But they did not deem the surveillance itself to be an illegal invasion of privacy; it was only the secrecy shrouding it that they ruled a violation of human rights. Friday’s decision was therefore more of a victory for transparency than it was for online privacy.

Eric King, deputy director of Privacy International, said the ruling showed spy agencies cannot justify mass surveillance using “secret interpretations of secret laws.”

“For far too long, intelligence agencies like GCHQ and NSA have acted like they are above the law,” King said in a statement. “Today’s decision confirms to the public what many have said all along — over the past decade, GCHQ and the NSA have been engaged in an illegal mass surveillance sharing program that has affected millions of people around the world.”

James Welch, legal director for Liberty, said that the group would continue its fight against GCHQ mass surveillance by taking a case to the European Court of Human Rights.

“We now know that, by keeping the public in the dark about their secret dealings with the National Security Agency, GCHQ acted unlawfully and violated our rights. That their activities are now deemed lawful is thanks only to the degree of disclosure Liberty and the other claimants were able to force from our secrecy-obsessed Government.

“But the Intelligence Services retain a largely unfettered power to rifle through millions of people’s private communications – and the Tribunal believes the limited safeguards revealed during last year’s legal proceedings are an adequate protection of our privacy. We disagree, and will be taking our fight to the European Court of Human Rights.”

The PRISM program was first exposed by the Guardian and the Washington Post in June 2013. Last year, The Intercept published new details about the scope of GCHQ’s access to PRISM, and revealed that the British agency was secretly pushing to obtain broader access to huge NSA data repositories. These public news reports formed a central part of the case against GCHQ, and were cited during witness statements.

GCHQ was dismissive of the IPT’s ruling in a statement posted on its website Friday, describing it as focusing on a “discrete and purely historical issue.” The agency pointed to a previous court ruling on its “bulk interception regime,” which it said was “fully compatible with human rights, in particular the right to privacy.”

Photo: GCHQ headquarters: Barry Batchelor/Press Association via AP.