The government's eavesdropping agency spied on one of world's most prominent civil liberties campaign groups, it has been revealed.
GCHQ put Amnesty International under surveillance, which the campaigning group said could jeopardise its work with dissidents in brutal dictatorships.
Salil Shetty, Amnesty International’s Secretary General said: “How can we be expected to carry out our crucial work around the world if human rights defenders and victims of abuses can now credibly believe their confidential correspondence with us is likely to end up in the hands of governments?
The surveillance came to light when Investigatory Powers Tribunal (IPT), which oversees the intelligence services, admitted it had wrongly identified which civil liberties group GCHQ had placed under surveillance.
The IPT said it was wrong to say GCHQ had spied on the Egyptian Initiative for Personal Rights (EIPR) and wrote to say the NGO that had been spied on was in fact Amnesty.
It made the mistake in a ruling on June 22, in which it said the intelligence services' spying on two NGOs was unlawful because it head retained the data it intercepted for too long.
Amnesty was one of a group of NGOs that took the case before the tribunal, which said it made no determination on whether Amnesty was spied on in its original ruling.
Shetty said the IPT error "highlights the gross inadequacies in the UK’s surveillance legislation".
"If they hadn’t stored our communications for longer than they were allowed to, we would never even have known. What’s worse, this would have been considered perfectly lawful," he added.
"After 18 months of litigation and all the denials and subterfuge that entailed, we now have confirmation that we were in fact subjected to UK government mass surveillance. It’s outrageous that what has been often presented as being the domain of despotic rulers has been occurring on British soil, by the British government."
Privacy International, another of the claimants, called the IPT's error a "monumental misstep" and "yet another display of the failure of oversight and redress mechanisms to provide genuine and rigorous public scrutiny of the British intelligence services".
In a statement, the group said: "Because the IPT is only required to reveal if a claimant has been the subject of surveillance if it concludes that surveillance was unlawful, the judgement of 'no determination' with respect to the other claimants does not mean that those organisations, including Privacy International, did not have their communications intercepted, only that the Court did not consider the intelligence agencies acted unlawfully."
Amnesty said it did not know how, when or why it was spied on or what was done with the information that was collected.
It called for an independent inquiry into "how and why a UK intelligence agency has been spying on human rights organisations".
The IPT's ruling, which mistakenly said EIPR had been spied on rather than Amnesty, said: "The Tribunal has found that email communications of the Third Claimant [EIPR] were lawfully and proportionately intercepted and accessed.
"However the time limit for retention permitted under the internal policies of GCHQ, the intercepting agency, was overlooked in regard to the product of that interception, such that it was retained for materially longer than permitted under those policies."
Amensty was one of two NGOs spied on. The other was South Africa's Legal Resources Centre.
Privacy International deputy director Eric King said: "The communications of one of the world’s leading human rights organisations - Amnesty International - were targeted by British spies, unlawfully, and our commissioners and courts failed to realise it.
"Without Edward Snowden, without an eighteen month legal battle, without an honest reckoning by whichever individual spotted and admitted this grave error, the unlawful conduct of the British intelligence agencies would never have been exposed by the very court charged with exposing it."
He added: "Today's farcical developments place into sharp relief the obvious problems with secret tribunals where only one side gets to see, and challenge, the evidence.
"Five experienced judges inspected the secret evidence, seemingly didn't understand it, and wrote a judgment that turned out to be untrue. We need to know why and how this happened.
"Any confidence that our current oversight could keep GCHQ in check has evaporated. Only radical reforms will ensure this never happens again.”