The coroner hearing the inquests for the 7/7 bombings has ruled against holding closed sessions to hear secret intelligence material.
Lady Justice Hallett rejected arguments by MI5 lawyers that she was able to exclude bereaved families from hearings to examine highly sensitive documents.
The information would damage national security if made public, MI5 had said.
Graham Foulkes, whose son David, 22, was killed at Edgware Road, said he was "delighted" by the decision.
Lady Hallett said the secret evidence could be edited to remove names of sources and other confidential information.
The coroner said: "I am still hopeful that with full co-operation on all sides, most if not all of the relevant material can and will be put before me in such a way that national security is not threatened."
Lawyers for the home secretary have been given seven days to appeal.
The attacks on a bus and three Tube trains on 7 July 2005 left 52 people dead.
Suicide bombers Mohammed Sidique Khan, Shehzad Tanweer, Hasib Hussain and Jermaine Lindsay had been planning the attacks for months.
Lawyers for the 7 July families want to question MI5 officers about why Khan and Tanweer, who had been under surveillance 17 months earlier, were not on the security service's "radar" at the time of the bombings.
MI5 has argued that it cannot give answers without disclosing information from top-secret intelligence files.
Lady Justice Hallett, who is sitting without a jury, ruled on Wednesday that she had powers under Rule 17 of the Coroners' Rules 1984 to exclude the public from the inquest if it was in the interests of national security.
But she ruled that this did not allow her to hold a secret inquest without key interested parties - such as lawyers for the bereaved families - being present.
The row echoes the case of Azelle Rodney, who was shot dead by police who said they were acting on intelligence.
The police refused to allow that intelligence to be heard in an open inquest and, after a protracted legal saga, the circumstances of his death are now being heard by a special public inquiry.
Lady Justice Hallett suggested that if ministers were unhappy with her ruling, they could transform part of the inquest into a public inquiry, to examine secret documents in closed hearings.
But the coroner warned this would lead to a lengthy delay which would further add to the suffering of the 7 July families.
She said: "The bereaved families and survivors have waited over five years since the bombings and I have promised them an end to these proceedings by next spring.
"Many witnesses have been through the ordeal of giving evidence, and I am sure would not wish to repeat that experience.
"The families have had to suffer the distressing experience of hearing witnesses speak of the deaths of their loved ones in all-too-graphic terms. They would not wish to relive that experience."
Mr Foulkes, who lives in Oldham, Greater Manchester, said the ruling would "make it more difficult" for MI5 to avoid public scrutiny.
He said: "The security service have this 'get out of jail' card to trump all others when they say it's a matter of national security.
"They have tried this so many times it's like crying wolf. The basic argument I have is that they said in 2005 that Sidique Khan was only known to them on the periphery of their investigation and he was not a major player.
"But they say they can't open their files about him because they are so sensitive they threaten national security.
"The ruling she's given makes it very hard for them to maintain that position," he added.
A Home Office spokesman said: "The government has made clear that it welcomes the coroner's inquests. We hope that they will allow the families of the victims to get to the bottom of the tragic events of July 7 2005.
"We will consider the coroner's ruling carefully."
Later the inquests heard from a paramedic who tried to treat Carrie Taylor, a 24-year-old from Essex, who died of her injuries.
Alan Treacy said: "She was gravely ill and she was in an unusual position where she was more or less wrapped around a handrail that was, if I recall, bent over as well.
"She was lying across the laps of a couple of people and I think there might have been another female helping her or holding her."
Miss Taylor's father John asked him what he did to try to save her.
Mr Treacy said she had no pulse but he decided to use a defibrillator to test for heart activity.
"Because Carrie was so young I decided to go further and see if there was any possibility of a pulse, but unfortunately there was nothing," he said.
Mr Taylor thanked him for his efforts and he replied: "I'm sorry I couldn't be more useful."