LONDON — A UK tribunal ruled on Friday that intelligence sharing between GCHQ and the NSA before December 2014 was not lawful because of a lack of transparency.

This is the first time the secretive Investigative Powers Tribunal, which oversees the actions of the UK's intelligence services GCHQ, MI5 and MI6, has ever upheld a complaint against an agency and it follows a ruling in December that the UK intelligence operation was not in breach of the European Convention on Human Rights.

Privacy International, Liberty, Amnesty International and other civil liberties groups brought the challenge questioning the legality of mass Internet surveillance carried out by the NSA through Prism and Upstream, following revelations from Edward Snowden.

The case focused on Article 8 and Article 10 of the European Convention on Human Rights, which cover privacy and freedom of expression. However, it said the programme is now compliant.

In our judgment the appropriate course is to alter the declaration we were otherwise minded to make as set out in paragraph 23 above in respect of the First Issue, so that the declaration we propose to make would recite that “prior to the disclosures made and referred to in the Tribunal’s Judgment of 5 December 2014 and this judgment” the Prism and/or Upstream arrangements contravened Articles 8 or 10 ECHR, but now comply.

The ruling was welcomed by civil liberties groups.

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

"We must not allow agencies to continue justifying mass surveillance programs using secret interpretations of secret laws, " he said. "The world owes Edward Snowden a great debt for blowing the whistle, and today's decision is a vindication of his actions."

In a joint statement, Privacy International and Bytes for All said they would now ask the court to confirm if the communications were collected illegally and, if so, request them to be deleted immediately.

GCHQ said the tribunal's ruling does not require it to change the way it currently operates. The agency also strongly played down significance of the ruling.

"Today’s IPT ruling re-affirms that the processes and safeguards within the intelligence-sharing regime were fully adequate at all times - it is simply about the amount of detail about those processes and safeguards that needed to be in the public domain. We welcome the important role the IPT has played in ensuring that the public regime is sufficiently detailed," a spokesman said. "By its nature, much of GCHQ’s work must remain secret. But we are working with the rest of Government to improve public understanding about what we do and the strong legal and policy framework that underpins all our work. We continue to do what we can to place information safely into the public domain that can help to achieve this".

Civil liberties groups are lodging an application with the European Court of Human Rights regarding the tribunal's ruling in December 2014.