A Palestinian man was sentenced to 14 years in prison on Friday for a knife attack on a German train last year that left four people injured.
The defendant, 28, identified in court only as Abdalrahman A, was convicted of attempted murder and bodily harm at at Munich state court in southern Germany.
Prosecutors argued there was an extremist motive behind the attack and had called for a life sentence.
Judges concluded that the defendant who grew up in Syria, had attempted to kill non-Muslims, a court statement said.
Defence lawyers argued he was a paranoid schizophrenic who could not be held criminally liable and called for his acquittal.
Judges said they were not convinced that the defendant had mental health issues at the time that would have influenced his criminal liability and said the man’s claims about such health problems were contradictory, variable and not credible.
Authorities initially said that the man attacked his victims apparently at random and showed signs of mental illness, but that there was no immediate indication of a terrorism motive.
Prosecutors later said that ISIS propaganda videos had been found on the accused and that material on his Facebook account also pointed in that direction.
The train stopped at Seubersdorf, between the Bavarian cities of Regensburg and Nuremberg, after the attack and investigators said the accused was arrested quickly and without resistance.
Abdalrahman A came to Germany in 2014 and was granted asylum in 2016. He had been living in Passau.