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.