A teenager accused of planting a bomb on a London Underground train last week allegedly bought components on Amazon, packing the device with shrapnel, a prosecutor said on Friday. Ahmed Hassan, 18, appeared in court on charges of attempted murder a week after the attack at Parsons Green station, which injured 30 people. Dressed in a grey jumper and white trousers, the teenager spoke only to confirm his name and address before prosecutor Lee Ingham briefly presented his case. The device contained hundreds of grams of the explosive triacetone triperoxide (TATP), the ingredients for which were bought from websites including Amazon, according to the prosecution. “The initiation blast went off but that did not generate the TATP charge, probably due to inaccurate construction,” Ingham told the court. Placed in a plastic bag, the bomb had all the necessary components including a timer, as well metal shrapnel made up of knives and screws, the prosecutor said. Hassan was arrested on Saturday after being recognised by an officer at the ferry port of Dover in southeast England. Ingham told the court the suspect had a “warped political view” and “hatred for the UK government and society”. The teen has said his parents were killed in Iraq, the prosecutor said. Hassan is believed to have lived with British foster parents in the London suburb of Sunbury. The house was one of several addresses searched by police after the attack. The explosion at Parsons Green station in southwest London, was Britain’s fifth terror attack in six months, and was claimed by Islamic State. Two other men aged 25 and 30 remain in custody in connection with the attack. A 17-year-old boy and two men, aged 21 and 48, have been released with no further action.