Claims brought against the British government by a group of Libyan men who were targeted by MI5 and MI6 on behalf of the Gaddafi regime have been thrown out because of evidence heard in secret by the high court.

The five based their claims on documents disclosing close links between the intelligence agencies of the UK and Libya, which were discovered in Tripoli following the overthrow of Muammar Gaddafi.

In a development that the group’s lawyers described as staggering, the high court said the UK government’s joint operations with the Gaddafi regime had been known to the courts for a decade, but that the details had been disclosed in secret.

Those operations included the so-called rendition of a pregnant woman and her husband, an opponent of Gaddafi, who were kidnapped in Thailand following an MI6 tip-off, and the abduction of a Libyan couple and their four children in Hong Kong.

Two of the kidnap victims were held for years in one of the dictator’s prisons. Information that was extracted from the pair was passed on to London, where it was used to justify the detention of the men who brought the high court claim.

After what he described as a case of “enormous length and complexity”, Mr Justice Irwin said all of the information that had emerged in the Tripoli papers had already been put before the highly secretive Special Immigration Appeals Commission (Siac), which had ordered the deportation of a number of the claimants from the UK to Libya.

“There was ample disclosure,” Irwin said, adding that this had taken place during closed sessions at the commission. “Siac considered the evidence fully.”

He added that the specially vetted lawyers known as special advocates who had been made aware of the evidence would not have been able to inform the Libyans once they emerged from a closed evidence session at Siac, even if that evidence showed that the men had a claim against the government.

“The special advocate cannot communicate with the party whose interest he or she represents,” he said, except to a limited extent with the permission of the government.

Irwin said the Libyans had been fully justified in bringing their claims against MI5 and MI6, the Home Office and the Foreign Office as they could not have known that Siac had considered the material that formed the basis for their case. But because the matters had already been considered by Siac, albeit in secret, the civil claims must be struck out.

The claims arose out of events during the period of rapprochement between Tony Blair’s government and the Gaddafi regime that began in late 2003. Among the papers discovered in Tripoli was a letter from Blair in which he thanks the dictator for “excellent co-operation” between the two countries’ counter-terrorism agencies.

One fax found in Tripoli showed that a senior MI6 officer, Mark Allen, insisted his agency should be given full credit for a tip-off that led to the abduction of Abdel Hakim Belhaj, a Gaddafi opponent who had been kidnapped in Thailand. At one point in the fax, Belhaj and his wife are referred to as “air cargo”.

Other papers showed how MI5 and MI6 submitted more than 1,600 questions to be put to Belhaj and a second kidnap victim, Sami al-Saadi, despite the widespread knowledge of the use of torture in Gaddafi’s prisons.

In 2006, the documents show, Gaddafi’s intelligence officers were permitted to operate alongside MI5 on British soil, where they allegedly intimidated a number of the dictator’s opponents who had been granted asylum in the UK.

The group’s solicitor, Gareth Peirce, said she had had to read and re-read Irwin’s judgment, as its contents were so disturbing and of such constitutional significance.

“In relation to the conduct of national security by the UK government and our security services, the courts themselves have become embroiled since evidence of such conduct never sees the light and is never investigated.

“Although the implications are clear, a court has now ruled, on the basis of evidence that the claimants will never see, that they cannot pursue the case for reasons also decided in closed proceedings, as to what happened a decade ago in a court that upheld the secretary of state’s application to keep them in detention for years.”

Peirce said it was ironic that the case law that the government’s lawyers relied upon in their successful attempt to have the case struck out was a Lords ruling in a damages claim brought by Gerry Hunter, one of six men convicted of two IRA bombings in Birmingham in 1974 in which 21 people died and 182 were injured. Hunter had been told he could not bring a claim as it would amount to an attack on his conviction in the criminal courts.

Hunter and the other five men, now known as the Birmingham Six, spent 17 years in jail before their convictions were overturned having been recognised as one of the gravest miscarriages of British justice in the 20th century.