A man accused of attempted murder and arson while dressed in a Joker costume on a Tokyo train in 2021 said Tuesday that a similar incident a few months earlier inspired him to alter his original plan of going on a killing spree in Shibuya.

Kyota Hattori, 26, who made the statement during his trial at the Tachikawa branch of the Tokyo District Court, admitted to stabbing a man and starting a fire onboard the train but denied the fire was intended to kill other passengers.

Police officers inspect a Keio Line train in Tokyo's Inagi on Nov. 1, 2021, a day after a man was arrested in a knife and arson attack that injured 17 people on the train. (Kyodo) ==Kyodo

Hattori said he conceived of the plan after learning about a knife attack on an Odakyu Electric Railway commuter train in August 2021, in which a man stabbed and slashed 10 passengers. During the incident, the suspect had poured cooking oil inside the carriage but failed to ignite it.

In response to questioning by the defense team, Hattori said he could not clearly remember his actions just before lighting the fire.

"I was quite nervous about committing murder. I was behaving unusually," he said.

Speaking about what led him to stab the man, who was in his 70s, Hattori said, "When I sprayed insect repellant, the man waved his arm around and hit my hand. I thought I was being counterattacked, so I thrust the knife toward his torso once."

During the opening hearing of his trial, prosecutors had quoted Hattori as having told investigators following his arrest, "I don't have any worth as a person. I have no choice but to kill a lot of people and get the death penalty."

According to the indictment, Hattori stabbed a man and attempted to kill other passengers by sprinkling lighter fluid and igniting it on a Keio Line train around 8 p.m. on Oct. 31, 2021.

The stabbed man was briefly in a critical condition, and his injury required around three months of treatment, it said.

Related coverage:

Tokyo "Joker" train attacker served new attempted murder warrant

Joker train attacker targeted Tokyo in hopes of increasing kill count

17 hurt as knife-wielding man in costume starts fire on Tokyo train