(CNN) -- A Muslim convert who tried to blow up a restaurant in southwest England was sentenced Friday to life imprisonment and must serve at least 18 years.
Police outside the Giraffe restaurant, Exeter, after the attack in May 2008.
Nicky Reilly accidentally detonated a nail bomb in the restaurant's rest room as he was preparing to target diners at the Giraffe restaurant in Exeter, Devon, in May 2008.
He pled guilty to attempted murder and preparing an act of terrorism at an earlier hearing.
Justice Calvert-Smith, quoted by the UK Press Association, said: "The offence ... is aggravated by the fact that it was long-planned, that it had multiple intended victims and was intended to terrorize the population of this country. It was sheer luck or chance that it did not succeed in its objectives."
Reilly, 22, of Plymouth, Devon, who suffers from Asperger's syndrome -- a form of autism -- and has learning difficulties, converted to Islam in 2002 or 2003 and in 2004 changed his name to Mohammad Rashid Saeed Alim, the court heard.
He also received encouragement in an Internet chatroom from two people with Arabic names, and he described himself as "Ali the Brit," PA reported.
Debbie Simpson, Devon and Cornwall Police Assistant Chief Constable, told PA said there was an ongoing investigation to Reilly's Internet associates.
She added: "We accept Saeed-Alim has Asperger's syndrome, but the judge has said today that he was fully aware of his actions and the consequences of them."
Defense barrister Kerim Fuad said Reilly was not part of a conspiracy.
Quoted by PA, Fuad said: "Had his poor unsuspecting mother not handed him the $10 note that she thought was for him to purchase a CD that morning, he would simply not have had enough money for the bus fare (from Plymouth) to Exeter."