MI5, MI6 and the police will be able to withhold evidence from defendants and their lawyers in civil cases for the first time, the high court ruled today.

In a move that has widespread implications for open justice, Mr Justice Silber agreed with the security and intelligence agencies that "secret government information" could remain hidden from individuals who are suing them.

His ruling was prompted by claims by seven British citizens and residents that they were ill-treated, and in some cases tortured, in Guantánamo Bay with the knowledge of Britain's intelligence agencies.

The seven – Binyam Mohamed, Bisher al-Rawi, Jamil el-Banna, Richard Belmar, Omar Deghayes, Moazzam Begg and Martin Mubanga – are suing the agencies, and the home and foreign secretaries, for unlawful acts, negligence and conspiracy. The government and its agents have denied the claims, but admitted that MI5 did interview a number of the detainees and had provided questions to be put to them by other interrogators.

"The security service undertook this role because, as the UK agency with the most experience of running intelligence-led counter-terrorist investigations in the UK, it was best placed to understand and utilise the information received about threats against the UK, or involving British nationals," the government's lawyers said in a court document. "At times, these interviews were facilitated by SIS [MI6] officers, and on occasions SIS officers conducted interviews themselves."

They have admitted that British intelligence officers interrogated Mubanga, a Briton, at least five times while he was held in leg cuffs at Guantánamo.

Government lawyers say they have identified 250,000 documents as "potentially relevant" to the case.

Currently, under what is known as the "public interest immunity" procedure, information deemed to be so sensitive by government agencies that it cannot be revealed is not used as evidence at all.

The only occasions when evidence and allegations have been withheld from defendants and their lawyers have been in cases directly linked to "national security" – for example those involving deportations. But if today's ruling stands, MI5, MI6, the police and other state institutions will be able to withhold relevant information from any civil action, for example for claiming compensation for wrongdoing.

Silber was not asked to consider the particular facts of the Mubanga case but to set down a principle. He argued that it would be better for "special advocates" to decide, in secret, what information in the hands of the government and its agents should be disclosed. However, he agreed that the issue raised what he called a "stark question of law".

His ruling provoked an angry response from lawyers for the Guantánamo claimants. Louise Christian said after the ruling: "The judge has sanctioned what would be a constitutional outrage, allowing government to rely on secret evidence in the ordinary civil courts … [he has done this] by treating the issue as if it was a purely technical legal matter, not a question of overturning the whole history of the common law and the fundamental principle that both sides must be on an equal footing."

Lawyer Irene Nembhard said the judgment would "wipe away the right to a jury trial for such claimants bringing such claims".

Clive Stafford Smith, director of the legal charity Reprieve, said: "When the history books are written, the darkest chapter of our current times will not be torture, but the seeping evil of secrecy, where the 'national interest' is conflated with 'national embarrassment', and ultimately anything of which the government is ashamed, from parliamentary expenses and working up to torture, becomes secret."