MI5's chief of staff has told the 7 July inquests that the security service cannot be held responsible for the 2005 London suicide attacks.
Giving evidence anonymously, Witness G said the agency had no inkling of what was to hit London and every member of the service felt profound regret.
It would be "nonsensical and offensive" to suggest MI5 bore any responsibility for the 52 deaths, the officer said.
Families of the bereaved were in court to see Witness G give evidence.
But reporters in a nearby annex could only hear his voice.
Four suicide bombers detonated their devices on three Tube trains and a double-decker bus on 7 July 2005.
Many of the relatives of those who died want to know why those under surveillance were not subjected to detailed scrutiny.
Witness G, who acts as chief of staff for the service's director general Jonathan Evans, said he had spent between three and four months preparing for the inquests, carefully reviewing what MI5 knew about the bombers before they attacked.
The inquests have already heard that the ringleader Mohammad Sidique Khan appeared on the periphery of another investigation, codenamed Crevice, in 2004 - but the security service concluded at the time he was not a threat to the UK.
It also heard how counter-terrorism officers watched, photographed and followed another of the suicide bombers, Shehzad Tanweer, during the same inquiry into the group of extremists planning a fertiliser bomb attack.
Questioned by Hugo Keith QC, counsel to the inquests, Witness G briefly outlined the scale of the threats to the UK during 2004 and 2005.
Mr Keith said: "The security service had no inkling of what was going to befall London?"
"On 7th July 2005, that is correct," said Witness G. "It would be nonsensical and offensive."
Witness G said there were "no guarantees" in national security because the security service could not foil all of the attacks all of the time.
Mr Keith said: "I understand that the security service says... that the service cannot be held responsible for causing or contributing to the attacks?"
Witness G replied: "That is correct."
Mr Keith went on: "And you reject the assertion that there were significant intelligence failings?"
Witness G replied: "I do."
Asked if lessons had been learnt from the follow-up of Crevice which was not "quite as thorough" as it might have been, Witness G said: "Not just Crevice, I think we learnt lessons from a number of operations between 2004 and 2005."
MI5 chiefs have previously told the Intelligence and Security Committee that in late 2004, their officers had an enormous workload because of massive growth in al-Qaeda-linked plots.
Witness G said this workload, revealed in documents to the inquests, meant the service was forced to "prioritise ruthlessly", and could only pin down the "crocodiles nearest the boat" rather than follow up every individual potential lead.
MI5 had received intelligence in early 2005 about a committed extremist called "Saddique" from Batley, West Yorkshire, who spent two months doing military training after travelling to Pakistan in 2001, the inquest heard.
Witness G was asked if MI5's system at the time allowed officers to collate the references to a suspect called Sidique, and he replied: "They could have done."
But he said the search was "still a long way from perfect on common names". He said the name Sidique was a common name for MI5.
In a bugged conversation, Sidique Khan was also heard discussing travelling to Pakistan to fight jihad with fertiliser bomb plot ringleader Omar Khyam in February 2004, although police only established it was Khan's voice on the tape after the 7 July attacks.
Mr Keith said: "Now that sort of tape would cause alarm bells to ring perhaps somewhat louder than had been the case in February 2004?"
Witness G said: "Yes, it would, but again within the context of if a major operation were running, it might need to be put to one side."
MI5 also received information in April 2004 from Mohammed Junaid Babar - a former terrorist who became a supergrass - that two men from West Yorkshire called "Ibrahim" and "Zubair" had travelled to a terrorist training camp in Pakistan the previous year.
Babar was shown surveillance pictures of Khan and Tanweer in August 2004 but failed to identify them, and it was only confirmed after the 7/7 attacks that "Ibrahim" was Khan.
Witness G was asked why a photograph of Tanweer but not one of Khan - known only at the time as "unidentified man E" - was shown to Babar in April 2004.
He replied: "I can only speculate here because we don't know exactly why.
"The judgement we formed was that the cropped photograph of man E was probably such poor quality it wasn't worth showing, but I don't have any contemporaneous record documentation."
Last month, the coroner Lady Justice Hallett granted a request from Home Secretary Theresa May for Witness G to give evidence anonymously.
But she refused to rule that the witness should be screened from the families of those who died.
The attacks were carried out by suicide bombers Mohammad Sidique Khan, 30, Shehzad Tanweer, 22, Hasib Hussain, 18, and Germaine Lindsay, 19.
They targeted Tube trains at Aldgate, Edgware Road and Russell Square and a bus in Tavistock Square.