A Japanese court on Monday sentenced a former care home employee to hang for knifing to death 19 disabled people and injuring two dozen others in the deadliest mass attack in post World War II Japan. The Yokohama District Court convicted Satoshi Uematsu of the killings and of injuring 24 other residents and two caregivers at the Yamayuri-en residential center in July 2016.

During the investigation and trial, Uematsu repeatedly said he had no regrets and was trying to help the world by killing people he thought were burdens. Advocacy groups said the suspect's views reflected a persistent prejudice in Japan against people with disabilities.

The trial focused on his mental state at the time of the crime. Chief Judge Kiyoshi Aonuma dismissed defense requests to acquit him because he was mentally incompetent due to a marijuana overdose.

Get Breaking News Delivered to Your Inbox

"The attacks were premeditated, and the defendant was acting consistently to achieve his goal," Aonuma said, according to NHK public television.

Satoshi Uematsu, suspected of a deadly attack at a facility for the disabled, is seen inside a police car as he is taken to prosecutors, at Tsukui police station in Sagamihara, Kanagawa prefecture, Japan, in this photo taken by Kyodo July 27, 2016. KYODO / REUTERS

"The crime, which took the lives of 19 people, was extremely heinous and caused damage that is incomparable to any other case," he was quoted by Kyodo News as saying.

Uematsu, his long hair tied in a pony tail and wearing a dark suit, listened as the judge delivered the ruling, according to drawings by an artist in the courtroom. After the judge declared an end to the session, Uematsu raised his hand seeking permission to speak, but was not allowed to do so.

Prosecutors said Uematsu's motive came from his biases and work experience at the home and not from use of marijuana. They said Uematsu was mentally competent and should take responsibility for his actions.

The killings mirrored a plot described in a letter that Uematsu had tried to give to a parliamentary leader months prior to the attack. He quit his job at the Yamayuri-en facility after being confronted about the letter and was committed to psychiatric care, but was released within two weeks, officials have said.

Uematsu, 30, told medical staff and officials that he was influenced by the ideas of Nazi leader Adolf Hitler, whose killings of disabled people were seen as intended to improve the perceived master race.

Japan maintains the death penalty despite growing international criticism. A government survey showed an overwhelming majority of the public supports executions. Japan and the U.S. are the only two countries in the Group of Seven industrialized nations that retain capital punishment.

Executions are carried out in high secrecy in Japan, where prisoners are not informed of their fate until the morning they are hanged. Since 2007, Japan has begun releasing the names of those executed and some details of their crimes, but disclosures are still limited.