A British judge has invoked Islamic theology in the sentencing of a teenager convicted of carrying out an attack on a tube train in central London.

Ahmed Hassan was sentenced to a minimum of 34 years in prison on Friday for the attack at Parsons Green station in September last year.

The explosive device he made failed to detonate completely and killed no one but left at least 30 people injured.

At the trial, Justice Charles Haddon-Cave said the 18-year-old sympathiser of the Islamic State of Iraq and the Levant (ISIL, also known as ISIS) group had committed 'hiraba' (terrorism) and caused 'corruption in the land'.

{articleGUID}

Both terms are used in Islamic law to describe acts of rebellion and are often used by theologians in the modern context to refer to "terrorism".

"You will have plenty of time to study the Quran in prison in the years to come," Justice Haddon-Cave said in his closing remarks at Hassan's trial.

He added: "The Quran and Islam forbid anything extreme, including extremism in religion. Islam forbids breaking the 'law of the land' where one is living or is a guest. Islam forbids terrorism.

"The Quran and the Sunna provide that the crime of perpetrating terror to 'cause corruption in the land' is one of the most severe crimes in Islam ... so it is in the law of the United Kingdom."

Hassan arrived in the UK as a 16-year-old refugee from Iraq just three years earlier.

At the time, he claimed to have been an orphan who had been kidnapped by ISIL.