A man accused of killing 19 residents at a care home in Japan for people with disabilities has pleaded not guilty, with his lawyers claiming that he was suffering from a psychiatric disorder at the time of the attack.

Satoshi Uematsu, a former employee of the Tsukui Yamayuri En (Tsukui Lily Garden) facility in Sagamihara, south-west of Tokyo, did not deny carrying out the attack in 2016, in which residents were targeted as they slept. Twenty-four other people were injured, most of them seriously.

Asked by the judge if he disputed anything in a statement prosecutors read out at the first hearing in his trial on Wednesday, Uematsu, dressed in a dark blue suit with his hair tied back in a ponytail, said: “No, there isn’t.”

His defence team, however, entered a plea of not guilty on the grounds of diminished responsibility, arguing that Uematsu had been mentally incapacitated at the time of the attack.

“He was in a condition in which either he had no capacity to take responsibility or such a capacity was significantly weakened,” his lawyer said. His legal team claimed that traces of marijuana found in Uematsu’s system may have affected his judgment.

Almost 2,000 people queued outside the Yokohama district court to enter a lottery for 26 seats in the public gallery. Relatives of the victims followed proceedings from behind partitions inside the courtroom.

The first court session ended in drama after Uematsu appeared to put something in his mouth and struggled with court officials before writhing around on the floor. Reports said that the hearing was due to resume later in the day, however.

Police believe the 29-year-old, described by neighbours as polite and helpful, was motivated by a deep-seated hatred of people with disabilities. He told police after his arrest that society would be better off if disabled people “disappeared”.

He allegedly broke into the care facility in the early hours of 26 July 2016 and fatally stabbed 10 women and nine men, aged 19- to 70-years-old. He then drove to the nearest police station to hand himself in. Police found a bag inside his car containing knives and other sharp-edged tools, and the seats were covered in blood.

Uematsu had been forcibly hospitalised in early 2016 after police contacted him about a letter he had sent to the speaker of the lower house of Japan’s parliament urging the government to introduce euthanasia for people with disabilities. He was released after 12 days when doctors deemed he did not pose a threat to others.

Since his arrest, Uematsu has expressed no remorse, telling the Mainichi Shimbun newspaper that people with mental disabilities “have no heart”, and “there’s no point in living” for them. “I had to do it for the sake of society,” he said of the attack.

The identities of most of the victims have not been revealed at the requests of their families – a reflection, critics say, of the stigma and shame people with disabilities still suffer in Japan.

But one woman whose 19-year-old daughter, Miho, was among those killed, told public broadcaster NHK that the trial had prompted her to speak out.

Photographs of Miho, who was autistic and unable to speak, showed her smiling when she entered junior high school and soon after she started living at the care home, months before she was killed.

“She loved music, she lived as energetically as she could,” her mother told NHK. “Her name was Miho. I want that public as proof that she existed,” she said. “I want people to know who she was.”

At the time, the Sagamihara attack was the worst mass killing in Japan since the second world war. An arson attack on an anime studio in Kyoto last July killed 36 people.

Uematsu faces the death penalty if convicted on some of the six charges, including murder. A verdict is expected on 16 March.