Giving evidence at the inquest into the victims’ deaths, the officer, identified only as Witness L, said the atrocity could not have been stopped.
“There simply wasn’t enough intelligence for us to work on that would have allowed us to identify his plot and work with the police to frustrate it,” he said.
He told the Old Bailey: “Masood engaged in attack planning on his own. It’s very difficult to make a decision as to when he decided to mount the attack.”
The court heard how Masood came to the attention of MI5 in 2004, when his number was found in the phone of Waheed Mahmood, one of a group of terrorists who plotted to plant fertiliser bombs.
He also had contact on a number of occasions between 2004 and 2009 with another suspect under investigation by MI5. The suspect had his address, email addresses and phone numbers.
In February 2010 there was a “vague and uncorroborated” report of someone called Khalid Masood – “an extremist based in Saudi Arabia” – helping a UK terror cell plan to travel to Pakistan to receive training from al-Qaida.
He was initially classed as someone who posed a threat to national security, but was downgraded to someone who may pose a threat a month later, when MI5 investigators discovered Masood was not involved.
In December that year a review found that as Masood was not involved in facilitating travel or in any other aspect of the plot, he could be downgraded again.
Witness L told the Old Bailey: “He was downgraded to a target who was not considered to be a risk to national security.”
No record was made at the time of the reasons why the decision was taken.
Counsel to the inquest Jonathan Hough QC read from a written statement by Witness L which said: “We have reviewed the decision to close Masood (as a person of interest) with the benefit of hindsight and we conclude the decision was sound.”
The officer went on: “It was logical, necessary and proportionate to consider him a closure.”
Between December 2010 and October 2012 Masood was associated with a number of subjects of interest to MI5 and there was “an indication that he consumed extremist material”, the court heard.
For the next four years he “appeared intermittently in connection with a number of other subjects of interest”, including some linked to banned extremist group Al-Muhajiroun, but at no stage was there considered to be enough information to justify investigating him further.
The officer said that even though Masood had a history of violent offending, had been linked to multiple terror suspects, and in 2013 expressed “satisfaction” that the 9/11 attacks had drawn people to Islam, the decision not to investigate him was “a sound one”.
Witness L said: “None of these indicators were enough to say that he was involved in activities of significant concern to us.”
At the time of the attack in 2017 the service was facing an “unprecedented” scale of work, with around 500 investigations into Islamist terrorists, 3,000 people considered subjects of interest (SOIs) and 20,000 who had previously been classed as SOIs.
Mr Hough read Witness L a conclusion from a report by former terror watchdog David Anderson after the atrocity that said: “Not everything can be stopped, there will always be a danger of a determined attacker getting through.”
The officer replied: “I’m afraid that’s true.”
He also gave his condolences to relatives of those who died.
“On behalf of both myself and my service I offer my profound sympathies to the families of those who were killed in Khalid Masood’s attack, those who were injured in the attack and anyone else who was affected by it.
“Everyone in my service comes to work every day to stop attacks.”
The Metropolitan Police commissioner, Cressida Dick, and deputy assistant commissioner Dean Haydon, a senior counter-terrorism officer, were in court as Witness L gave evidence.
Masood, 52, ploughed a hired vehicle into pedestrians Kurt Cochran, 54, Leslie Rhodes, 75, Aysha Frade, 44, and Andreea Cristea, 31, on Westminster Bridge on March 22 last year, before stabbing Pc Keith Palmer, 48, to death near the Houses of Parliament.
Gareth Patterson QC, for the families of the four civilians killed in the attack, said: “I suggest a proper investigation would have been likely to have revealed not only his extremist views, which were there to be discovered, but the danger that he posed.”
Witness L replied: “I believe that such a hypothetical investigation would have exposed his extremist views, I don’t believe it would have exposed his attack planning.”
Additional reporting by Press Association