Khalid Ali, 28, was arrested near parliament in possession of three knives on 27 April last year, just four weeks after the Westminster attack which killed five people.
The Old Bailey heard that Ali had been plotting an attack after spending five years making bombs with the Taliban in Afghanistan, and had returned to the UK in November 2016.
Ali said that he visited Pakistan for tourism and hitchhiking but was kidnapped and driven to a remote location in the boot of a car.
He told the jury that he was suspected of being a British spy and was forced to work at gunpoint, bundling up detonators for explosive devices and matching transmitters with receivers.
If I didn’t do what they told us to do then I would be shot, he said.
They told us to prove that you’re not a British spy, make these things.
He also told the court that MI5 had attempted to recruit him before his travels, asking him to spy on people at local gyms, mosques and internet cafes.
He met with operatives twice and was paid £80-100 on one occasion, although he says he wasn’t willing to engage and chose not to take up the offer.
According to the prosecution, Ali was intending to target MPs, police officers and army personnel, and had carried out a hostile reconnaissance around the capital last year.
The prosection says that he had scoped out places including Downing Street, New Scotland Yard, the Ministry of Defence, the MI6 building and the Cenotaph on 18 March and 22 April last year.
Last week, the court released bodycam footage of the moment he was arrested by armed police.
The dramatic video shows Ali on the pavement being held down by armed officers and asked if he is in possession of any objects which would cause harm.
The defendant then says You’ll see.
Prosecutor Alison Morgan said that his DNA was found on all three of the knives.
Ali, a plumber from north London, denies possessing explosives with intent abroad and preparing a terrorist plot in the UK.
The trial continues.
News Source SkyNews