MI5 today expressed "profound regret" for failing to prevent the 7/7 bombings.
One of the Security Service's most senior officers told the inquest into the attacks that every member of the agency lamented the fact that plot ringleader Mohammed Sidique Khan was not fully investigated before the atrocities.
The top spy, who can be named only as Witness G, insisted MI5 had "no inkling" of what was to befall London on July 7 2005 and said it would be "nonsensical and offensive" to suggest otherwise.
Hugo Keith QC, counsel to the inquest, said: "You have nevertheless recorded that it is a matter of profound regret that despite its efforts and industry, the Security Service did not manage to ascertain the full significance, and intentions importantly, of Mohammed Sidique Khan and thus did not manage to prevent the atrocities of July 7."
Witness G said: "Every member of the service feels that."
Khan and his number two, Shehzad Tanweer, were seen meeting known terror suspects 17 months before the July 7 2005 London bombings, which killed 52 innocent people.
Witness G was called to give evidence to the inquest about whether Britain's security agencies could have drawn together intelligence about the pair's links with extremists and established they were planning mass murder.
The top spy, who is chief of staff to MI5 director general Jonathan Evans, spoke of the large number of serious terrorist conspiracies under investigation around the time of the 7/7 attacks.
He described a plot to bring down transatlantic airliners foiled in 2006 as the gravest threat faced by the Security Service since the Second World War.
"In terms of the seriousness of the plot, I believe it is the most significant thing the service has been involved in since 1945," he said.
Witness G defended MI5 against the suggestion it could in some way be held responsible for the July 7 atrocity.
Asked if he rejected the assertion that there had been "significant intelligence failings", he replied simply: "I do."
The inquest has heard how counter-terrorism officers watched, photographed and followed Khan and Tanweer in early 2004 during their inquiry into the group of extremists planning a fertiliser bomb attack, but did not fully identify them at the time.
Following the conclusion of this investigation, code-named Crevice, they launched Operation Scrawl.
This sought to follow up individuals who had come to their attention during surveillance of the core Crevice plotters.
While they had unearthed some 4,000 "contacts", the task was assigned to just one MI5 officer, the inquest heard.
This person, though given some assistance, was also responsible for "other work going on at the time," Witness G told the hearing.
But he said the Service had subsequently beefed up its reviewing techniques.
Asked if lessons had been learnt from the follow-up of Crevice which was not "quite as thorough" as it might have been, he said: "Not just Crevice, I think we learnt lessons from a number of operations between 2004 and 2005."
The inquest is looking at whether MI5 could have drawn together different strands of intelligence about Khan's links with extremists and established that he was planning mass murder.
Many 7/7 survivors and relatives of those killed in the attacks argue that MI5 had enough information about the bomber to make him a priority for an in-depth investigation which would have uncovered his plot.
Witness G, who in July 2005 was a senior manager in a department which worked to counter international terrorism, explained that this area consumed the largest part of the Security Service's budget.
Spending had increased dramatically in the years leading up to 7/7, he said.
But, at the time, there was concern that a somewhat limited budget meant the service was forced to "prioritise ruthlessly" and could only pin down the "crocodiles nearest the boat".
By July 2005, efforts were under way to boost resources but these are only nearing completion now - more than five years after the worst single terror attack on British soil.
"The planning process really began in 2001 and is only coming to an end now," Witness G told the hearing.
Outlining one problem area in 2005, Witness G told the hearing the service had difficulties in "regional liaison" with local police forces and Special Branch.
In this area, he said, lessons had been learned and improvements made.
Mr Keith asked him: "If steps had been taken before 2005, whilst you can't say for sure, you might have been able to increase your intelligence understanding of what might have been happening in the Dewsbury area?"
He replied: "Yes, I think that's fair."
MI5 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.
This man was prepared to use a baseball bat and was capable of carrying out a martyrdom operation, according to the source.
Witness G was asked if MI5's system at the time allowed officers to collate the references to a suspect called Sidique.
He replied: "They could have done. Software has improved over the years and this sort of search, which is known as fuzzy searching, is better now than it was then.
"But it's still a long way from perfect on common names."
The task was more difficult because there are a large number of people called Sidique Khan on MI5's database, the inquest heard.
The senior spy said: "Much depends on the name. A highly uncommon name is something that current software technology may be able to pick up.
"With a common name, as this one would be for us, any software which picks up any reference to it would be likely to come up with all sorts of other Sidique Khans."
Asked about how straightforward it was to dig into MI5's files to search for information about a suspect, he said it could be "very difficult" if they did not have their own record on the system.
Khan was bugged discussing travelling to Pakistan to fight for jihad with fertiliser bomb plot ringleader Omar Khyam in February 21 2004, although police only established it was Khan's voice on the tape after the July 7 attacks.
Witness G, who has been a member of MI5 since 1991, agreed that insufficient regard was given at the time to the speed and ease with which people can go from supporting terrorism to planning 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 received information in April 2004 from al Qaida supergrass Mohammed Junaid Babar 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 judgment 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."