A bomb on a London Underground train last year that injured 30 people but failed to detonate fully could have been fatal, an explosives expert said on Friday at the alleged attacker's trial. The device, which went off during morning rush hour on September 15, contained nails and knives, packed with 400 grams of TATP, an unstable high explosive often used in jihadist attacks. "400 grams of TATP has the potential to cause damage to property and harm or seriously to those in closest proximity which could potentially be lethal," expert Sarah Wilson told the court. Asked why the device had failed to function, Wilson said the bomb may have been wet or not built correctly. But she agreed that it contained "all the elements necessary" for a viable bomb. Ahmed Hassan Mohammed Ali, an 18-year-old Iraqi who had been living with a foster family in Sunbury, southwest of London, is accused of attempted murder and causing an explosion. He denies the charges. Hassan arrived in Britain in October 2015. He told authorities he was in fear of the Islamic State group and that it had taken him by force and trained him "how to kill" when he was in Iraq. Prosecutors said the suspect used \u00a320 (23 euros, $28) that he won in a school prize to go on Amazon to buy the main component for the bomb, which he built in his foster family's kitchen. Victims of the attack on Thursday described the "fireball" that tore through the train carriage. Having got off one stop before, Hassan fled to Dover in Kent where he was picked up by police the following day. The attack, claimed by IS, was the fifth time Britain had been targeted in six months.