Khalid Mohammed Omar Ali has been found guilty of plotting to commit a terror attack on MPs and police and for making explosive devices for the Taliban.

The 28-year-old British national from Edmonton, North London, was arrested by police on 27 April 2017 in Parliament Street — just yards from Prime Minister Theresa May’s Downing Street residence — and was found in possession of three knives.

A jury convicted Ali at the Old Bailey of preparing an act of terrorism in the UK and two counts of possessing an explosive substance with intent, reports the BBC.

The prosecution had told the jury that Ali went to Westminster “for one reason and one reason only – to launch a deadly terror attack to strike at the very heart of this country’s democracy, by killing a police officer, a member of the military or even a parliamentarian”.

Just four weeks before his arrest, Islamist terrorist Khalid Masood carried out his deadly attack, running down pedestrians on Westminster Bridge with his car, killing four, before committing a fatal knife attack on PC Keith Palmer who was on duty at the House of Commons.

LONDON, ENGLAND – APRIL 27: A man (L) is detained by police officers near Downing Street, on Whitehall on April 27, 2017 in London, England. Multiple knives were seen at the scene close to Parliament Square and are being investigated. (Photo by John Phillips/Getty Images)

The court also heard that Ali told police he owed his loyalty to the Taliban and al-Qaeda and that he wanted to “deliver a message to the leaders and decision-makers of this country”.

Before the attempted attack, Ali had returned from Afghanistan where he had spent five years making bombs to kill coalition troops. Ali admitted to fighting with British soldiers when he was in Afghanistan, but refused to confirm if he had killed any.

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

When Ali had returned to the UK in November 2016, he was temporarily detained by police and his fingerprints and a DNA sample were taken which were then shared with the FBI who identified him as a bomb maker for the Taliban in Afghanistan, based on matching fingerprints taken off of device components.

However, Ali was not arrested until he was armed and walking towards the House of Commons – the decision defended by Deputy Assistant Commissioner Dean Haydon who said police and security services were “managing any potential risk he posed and he was arrested at the most appropriate time”.

The convicted terrorist is due to be sentenced on July 20th.