A man has been sentenced to death in Japan for killing 19 disabled people and injuring dozens of others during a knife-wielding rampage at a care home.

During his trial, Satoshi Uematsu repeatedly said he had not regrets for carrying out the deadliest mass attack in the country’s post-war history, and that he targeted the care home’s residents because their mental illnesses made it harder for them to defend themselves.

The 30-year-old was himself a former care worker at the Tsukui Yamayuri-en care home in Sagamihara, near Tokyo, where he launched the attack lasting several hours in July 2016.

As well as the 19 residents killed, Uematsu injured 24 others and two care workers. Most of the victims were stabbed while they slept.

The trial focused on Uematsu’s mental state at the time of the attack, with defence lawyers arguing that he could not be held criminally responsible because he had been mentally incompetent by long-term cannabis use.

But prosecutors said the attacker was motivated by his experiences working at the home and his extremist views, influenced by his interest in Adolf Hitler and Nazi Germany, that the disabled were a burden on society.

Uematsu had detailed a plot to kill disabled people in a message he tried to hand to a parliamentary leader months before the massacre. He quit his job at the Yamayuri-en care home when confronted with the contents of the letter and was committed to psychiatric treatment, but officials said he was released within two weeks.

Citing the “extreme maliciousness” of the attack, presiding judge Kiyoshi Aonuma dismissed the defence’s claim of diminished responsibility, saying: “This crime was pre-meditated and there was strong evidence of the desire to kill.”

Dressed in a black suit with his long hair tied back in a ponytail, Uematsu, looked calmly at the judge during the sentencing session in a courtroom filled with family members of the victims. Convicted of homicide among other charges, he was sentenced to death by hanging.

Uematsu had said during his trial that he would not appeal the court’s decision, whatever the verdict, in a case that has drawn focus on the stigma faced by disabled people in Japan today.