An al Qaida bomb-maker has been found guilty of plotting a knife attack on MPs and police outside the Houses of Parliament.

Khalid Ali, 28, had three blades tucked into his clothes when he was arrested by armed police in Whitehall last April.

The plumber had been in the sights of counter-terrorism police since he returned from Afghanistan, where he spent five years making bombs to maim and kill coalition troops.

More than four months before his arrest, the FBI in the United States matched his fingerprints to two caches of explosives recovered by Afghan forces in 2012.

Following an Old  Bailey trial, Ali was found guilty of preparing terrorist acts in Britain and two charges of  possessing explosive substances with intent to endanger life abroad.

Khalid Ali court case
Three knives were seized when Khalid Ali was detained in Whitehall on April 27 last year (Metropolitan Police/PA)

Prosecutor Brian Altman QC had told the jury that Ali planned a “deadly terror attack at the very heart of this country’s democracy by killing a police officer, a member of the military or even a Parliamentarian”.

He said: “Chillingly, but for the interception of the defendant by police, he would have carried out yet another murderous terror attack in Westminster.”

The court had heard how Ali’s family in Edmonton, north London, reported him missing in June 2011 after he disappeared without warning.

He resurfaced at the British Consulate in Turkey more than five years later, claiming he had lost his passport.

In November 2016, the loyal Taliban and al Qaida follower was stopped at Heathrow Airport, interviewed by police and his fingerprints and DNA samples were taken.

He told officers he had been involved in a Road to Hope convoy to Palestine in 2010 and claimed to have gone to Pakistan, after he was put under pressure to marry a “gold-digger”.

He also claimed MI5 had tried to recruit him as a “James Bond”-type spy before he left the UK.

In late 2016, Ali’s DNA and fingerprints were shared with the FBI agents and 42 prints linked him to the IEDs in Afghanistan.

Meanwhile, he had resolved to carry out an attack on Westminster to “send a message” to British authorities, jurors were told.

On March 18 last year, he carried out reconnaissance under the cover of a Stand Up To Racism march, which took him past Downing Street and the Cenotaph.

On April 22 last year, he was caught on CCTV walking past the MI6 building at Vauxhall Cross, as well as Westminster Bridge, the Houses of Parliament and Whitehall.

Khalid Ali court case
Khalid Ali was captured in Berwick Street, London, carrying out reconnaissance in Whitehall during a march on March 18 2017 (Metropolitan Police/PA)

Just after midnight on April 27, his mother called police, saying she had found four knives in her son’s bedroom and she was scared he was going to kill the family.

The jury, who deliberated over three days, heard Ali had bought the blades two days before at The Mighty Pound in Ealing, west London, and had been seen by surveillance officers to throw away the packaging.

After leaving his mother’s home, Ali went to Ealing where he set about rearming himself with an 8in chef’s knife and two 3.4in paring blades from Wilko, purchasing other kitchen utensils including a potato masher as cover.

He also bought a rucksack with a Union Jack and London logo on it, before travelling by Tube to carry out his attack, which came just four weeks after the Westminster Bridge killings.

He deliberately dropped his mobile phone into the Thames, but it was later recovered by police divers.

When armed police moved in to arrest Ali, the knives were seized from his jacket pockets and the waistband of his tracksuit bottoms.

Khalid Ali court case
The moment Khalid Ali was detained in Whitehall on April 27 last year (Metropolitan Police/PA)

In police interview, Ali said he wanted to deliver a “message” to British authorities, but claimed the knives were for protection.

When asked if he had returned for jihad, he replied: “Jihad is what we do. We are Mujahideen.”

He admitted involvement in IEDs in Afghanistan, even bragging he detonated more than 300 devices, although he later backtracked.

Giving evidence, Ali went on to claim he had been held captive by the Taliban and forced to make bombs.

On why he was armed on the day of his arrest, he said: “I had the knives ready to kill, but only in self-defence.”

Khalid Ali court case
Khalid Ali bragged about detonating IEDs in his police interview (Metropolitan Police/PA)

Following his conviction, Deputy Assistant Commissioner Dean Haydon said: “This case demonstrates how close the UK counter-terrorism network works with partners and allies to bring to justice those seeking to harm others across the world.

“He is an incredibly dangerous individual who had returned from a terrorist training camp in Afghanistan with a determination to kill, we believe, police, the military or Parliamentarians in the UK.”

He said there was a “time lag” between the FBI linking Ali to the Taliban bombs and his arrest because “due legal process” needed to be followed to collect the evidence from abroad.

He defended the decision not to move in before Ali was armed and within metres of the Houses of Parliament, saying police and security services were “managing any potential risk he posed and he was arrested at the most appropriate time”.

Ali gave no reaction in the dock as he was convicted.

Judge Nicholas Hilliard QC remanded him in custody to be sentenced on July 20.

Sue Hemming, from the Crown Prosecution Service, said: “Khalid Ali planned to carry out a vicious knife attack in London that could have injured many and endangered life.

“He also boasted of working as a Taliban bomb-maker in Afghanistan targeting US-led forces as well as Afghan security personnel.

“The jury agreed with the prosecution that he was engaged in terrorist acts at home and abroad and he is clearly a danger to the public in this country and elsewhere.”

Security Minister Ben Wallace said: “This verdict demonstrates the hard work and dedication of those that continue to keep us safe day and night.

“This individual was intent on causing harm. He was a danger to the public and was stopped in his tracks, now he has faced justice thanks to the superb efforts of the police, security services and Crown Prosecution Service.

“It is a reminder of the threat we continue to face.

“That is why our recently published strengthened counter-terrorism strategy will continue to make sure we have the right approach, and all the tools we need, to continue disrupting terrorism.

“Alongside this, the key role that retained biometric data played in alerting the police and security services to the threat Khalid Ali posed is why it is vital we are seeking to enhance existing powers in the Counter Terrorism and Border Security Bill that is currently being debated in Parliament.”