LONDON — An 18-year-old Iraqi asylum seeker was sentenced on Friday to life in prison in Britain after he was convicted of attempted murder in the botched bombing last September of a rush-hour train on the London Underground, which injured 30 people.

Ahmed Hassan was convicted last week after he left the bomb that partially exploded one stop after he had disembarked. The explosion triggered a stampede that injured tens of passengers.

The judge in the case said that Mr. Hassan had constructed a bucket bomb filled with screwdrivers, knives, nuts, bolts and explosives and detonated it on a train carriage with 93 passengers, hoping “to kill as many members of the British public as possible.”

Speaking at England’s Old Bailey central criminal court in London, Judge Charles Haddon-Cave called Mr. Hassan a “dangerous and devious individual” who had let down the country that gave him shelter, the foster charity that cared for him and the college he attended.

Ahmed HassanCredit…Metropolitian Police, via Reuters

The judge said he believed Mr. Hassan had trained with the Islamic State in Iraq.

Mr. Hassan told jurors that he did not intend to hurt people and that he was “bored and stressed” and wanted to start a fire. “It became kind of a fantasy in my head. I was thinking about it,” he said.

Prosecutors had shown jurors a record of Mr. Hassan’s purchases online, which included chemicals, along with security camera footage from the day before the attack showing him buying shrapnel items.

Mr. Hassan told the authorities he was in fear of Islamic State, which he said had taken him by force in Iraq and trained him “how to kill.”

займ 30000 рублей