An Iraqi asylum seeker who tried to murder Tube commuters with a homemade bomb on a packed train at Parsons Green was taught how to kill by ISIS, a court heard today.

Ahmed Hassan, 18, packed more than 2kgs of shrapnel into his improvised explosive, made from chemicals he had bought online from Amazon and hooked up to a modified kitchen timer, it is said.

The teenager, who was claiming asylum after entering the UK on the back of a lorry, allegedly planted the bomb, packed into a bucket inside an Aldi shopping bag, on a District Line train heading into central London last September.

Prosecutor Alison Morgan told a jury today the bomb sent a "large fireball" shooting through the carriage, containing 93 people, when it partially detonated at Parsons Green station.

"Some in the carriage were caught by the flames and sustained significant burns", she said.

"Many ran in fear and panic. They were fortunate. Had the device full detonated, it is inevitable serious injury and significant damage would have been caused within the carriage. Those in close proximity to the device may well have been killed.

"The passengers fled from the Tube as quickly as they could. Hundreds of people tried to get down a narrow staircase and out of the barriers of the station."

Ms Morgan said the shrapnel, including including sockets, screws, bolts, nails, knives, screw drivers, was "designed to be propelled out of the device during the explosion, causing maximum harm and carnage to those in the surrounding areas".

Around 20 months before he detonated the bomb, Hassan told the UK authorities he had been "trained to kill" by ISIS, the court heard.

In a Home Office interview in Croydon in January 2016, Hassan was questioned about his asylum claim, which was based on his treatment under ISIS in Iraq.

Asked if he had been trained by ISIS, Hassan said: "They trained us on how to kill. It was all religious based."

He said he was recruited on his own but trained with around 1000 others, spending up to four hours a day in the mosque.

Hassan denied he had been sent to Europe by ISIS, and in a second interview while accompanied by a solicitor, he repeated his claims.

He said he was "taken by force" by the extremists, who forced him to "train how to kill and they would teach him about religion and what Allah believed was right".

Hassan said he was set free when Iraqi soldiers stormed the ISIS territory and freed the children.

Prosecutor Alison Morgan said a member of staff at Barnados, who gave Hassan a place to stay shortly after he arrived in the UK, overheard him listening to an Arabic "call to arms" song.

"He heard words to the effect of 'we are coming with you to the slaughter'."

The court heard Hassan studied media at Brooklands College in Surrey, focusing on photography and film making.

He was taken in by foster parents, Mr and Mrs Jones, until the Tube bombing on September 15 last year.

Prosecutors said Hassan had already got off the train at Putney Bridge and was on a bus towards Earl's Court at the time of the explosion, just before 8.20am on September 15 last year.

"The carriage became more crowded at each stop, as more passengers got on", said Ms Morgan.

"At 8.17am, when the Tube pulled into Putney Bridge station, the defendant got off, leaving the device on the floor of the carriage.

"He walked off, down the steps, and out of the station without speaking to anyone or even looking back at the Tube."

After playing dramatic CCTV footage of the explosion to the jury, Ms Morgan said victims included Jelena Semenjuk, who suffered burns to her legs, hands and face, Aimee Colville, who realised her hair was on fire after the blast, and Alex Bevan, who saw a "fireball rolling towards him in the carriage".

Stephen Nash described the aftermath of the blast as "feeling like he was in a furnace", while Georgina Bale was injured in the stampede as commuters fled the train, the court heard.

Ms Morgan said Hassan began making the bomb in late August, creating a volatile explosive using hydrogen peroxide, acid and nail varnish remover.

The prosecutor told jurors the chemicals "are not difficult to acquire", and Hassan purchased his on Amazon.

The teenager was living with foster parents in Sunbury-upon-Thames at the time of the bombing, but they went on holiday at the start of September and Hassan had time to prepare the bomb.

On the day of the incident, he took the train from Sunbury to Wimbledon before spending 13 minutes in the station toilet, allegedly arming the bomb before getting on the District Line train.

Hassan was arrested at the port in Dover, nearly 24 hours after the explosion, the court heard.

Explaining the teenager's background, Ms Morgan said: "We know that he came into this country in October 2015 and claimed asylum.

"Having travelled through the Channel Tunnel on a lorry, he arrived without any identity documents. He gave his name as 'Ahmed Hassan Mohammed Ali' to the authorities, and said that he had been born on June 1, 1999 in Iraq.

"If that is correct, he is now 18 years old. He was given accommodation and by the middle of 2016 onwards was living with foster parents."

Hassan, from Sunbury, Surrey, denies attempted murder and causing an explosion likely to endanger life or damage property.

The trial continues.