Intelligence agency GCHQ unlawfully spied on British citizens before December last year, a secretive UK court has found.

In its first ruling against an intelligence agency since it was set up in 2000, the Investigatory Powers Tribunal (IPT) declared today that GCHQ's access to information intercepted by the US National Security Agency (NSA) breached human rights laws.

It comes after whistleblower Edward Snowden revealed that NSA's mass surveillance programmes Prism and Upstream had been providing GCHQ with intelligence about UK citizens.

The tribunal found that GCHQ had not been sufficiently transparent with the public about the way in which it was able to gather information about them. However, it said the disclosures made in an earlier judgment in December put that information sufficiently in the public domain, meaning GCHQ was no longer breaking the law.

In the initial December ruling, the IPT found that the current system of collecting UK intelligence did not breach the European Convention of Human Rights.

The challenge was brought by civil liberties groups including Liberty and Privacy International.

Eric King, deputy director of Privacy International, said today's ruling was a "vindication" of Snowden's actions. "We must not allow agencies to continue justifying mass surveillance programmes using secret interpretations of secret laws," he told The Guardian.

"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 programme that has affected millions of people around the world."

However, GCHQ argued that the decision was based on a technicality.

"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," a spokesperson said.

As part of the government's defence, Charles Farr, the director general of the Office for Security and Counter Terrorism, explained how searches on Google, Facebook, Twitter and YouTube, as well as emails to or from non-British citizens abroad, could be monitored legally by the security services.