GCHQ online surveillance was ruled unlawful [PDF] by a secretive UK court today.

The Investigatory Powers Tribunal (IPT), the court responsible for monitoring British intelligence agencies, said that GCHQ activity allowing access to data from the US National Security Agency (NSA) breached human rights law.

IPT said that the breached European laws related to Article 8, which covers the right to respect for private and family life, as well as Article 10, which refers to freedom of expression.

“…prior to the disclosures made and referred to in the First Judgment and the Second Judgment, the regime governing the soliciting, receiving, storing and transmitting by UK authorities of private communications of individuals located in the UK, which have been obtained by US authorities pursuant to Prism and/or (on the Claimants’ case) Upstream, contravened Articles 8 or 10 ECHR.”

This is the first instance that the secretive court has ruled against a British agency since its formation in 2000. In December of last year it found that GCHQ surveillance of UK citizens was legal from then onwards, however that ruling is now being appealed.

Today’s decision refers to historical spying as illegal as the regulations surrounding how the UK could collect data from the NSA were kept secret. The ruling particularly focused on the activities disclosed by former CIA contractor Edward Snowden, and concerned the NSA spying programmes PRISM and UPSTREAM.

PRISM reportedly permitted the NSA to access information from top tech firms such as Microsoft, Google and Facebook, while UPSTREAM involved the interception of data through fibre optic cables.

The tribunal’s ruling follows legal battles initiated by Amnesty International, Liberty, Privacy International and other civil liberties groups.

“For far too long, intelligence agencies like GCHQ and NSA have acted like they are above the law,” said deputy director of Privacy International Eric King. “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.”