A court Wednesday sentenced a man to life in prison over a random knife attack aboard a shinkansen last year that killed one passenger and injured two others.

Ichiro Kojima, 23, had admitted to the charges of murdering 38-year-old Kotaro Umeda and attempting to kill the two women during his trial at the Odawara branch of the Yokohama District Court in Kanagawa Prefecture.

"(The accused) has shown no remorse and he cannot avoid harsh condemnation. It is reasonable to have him reflect on his criminal responsibility while serving (life) in a prison," said presiding Judge Yuki Sawaki when handing down the sentence.

The ruling was in line with the request of prosecutors, who did not seek the death penalty in consideration of Kojima's personality disorder.

The accused underwent a psychiatric examination before his indictment and was diagnosed with the disorder, although prosecutors determined that he was fit to face a criminal trial.

Prosecutors insisted the accused "committed a brutal random killing based on a selfish desire to spend the rest of his life in prison."

"I did it with the intent to kill," Kojima had said in the first court hearing in his lay judge trial. At the time, prosecutors said Kojima had found it too difficult to live on his own and "wanted to go to prison" as he had been homeless and sleeping outdoors.

Kojima's defense team had sought leniency, arguing that he may repent if given the chance.

According to the ruling, Kojima killed Umeda from Amagasaki, Hyogo Prefecture, by slashing him with a machete and a knife while aboard the shinkansen train. He also severely wounded two women in their 20s on the Nozomi 265, en route from Tokyo to Shin-Osaka, while it was in Kanagawa Prefecture on the evening of June 9, 2018.