LONDON (Reuters) - A British man who had made bombs for the Taliban in Afghanistan and was plotting an attack near London’s parliament was jailed for life with a minimum term of 40 years at the Old Bailey court on Friday.

Khalid Ali, 28, was carrying three knives when he was arrested by armed police in April last year.

Only just over a month earlier, a British-born convert to Islam had ploughed a car into pedestrians on nearby Westminster Bridge, killing four people, before stabbing a policeman to death in the grounds of parliament.

Ali had intended to kill a police officer, a member of the armed forces or even a Member of Parliament, the Crown Prosecution Service (CPS) said.

Five days before he was stopped, Ali visited potential targets such as Westminster Bridge, the Houses of Parliament and Whitehall.

His fingerprints matched those found on bomb-making components recovered in Afghanistan in 2012 and held on an FBI database, the CPS said in a statement.

Some of the prints were on the sticky side of adhesive tape used in their manufacture which the prosecution argued indicated he had made the devices and was not merely handling them.

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