Somali-origin Muhiddin Mire targeted people at random during the attack at Leytonstone station in east London on December 5 and grabbed 56-year-old musician Lyle Zimmerman in an attempt to behead him.
Sentencing him at the Old Bailey court in London, Judge Nicholas Hilliard said though Mire was suffering from paranoid schizophrenia at the time of the offence, he was motivated by events in Syria.
"In other words, because Muslims were being bombed in Syria, he was going to attack civilians here. That was designed to intimidate a section of the public, and it was to advance an extreme cause," the judge said, adding that the streets of London would be safer with Mire behind bars.
Mire has a history of mental illness and psychosis, including the paranoid belief that he was being persecuted for his religion and stalked by Britain's MI5 and MI6 security services, the court was told.
Also Read
The judge praised the heroic actions of some of the commuters on the day of Mire's rampage last year.
Judge Hilliard also praised the police officers who "carried out their duties in extremely frightening circumstances".
He moved to Leytonstone in 2011, taking jobs as an Uber taxi driver and a council estate caretaker but was forced to give up work because of anxiety, panic attacks, and depression.