Passengers flee to different cars of a Keio Corp. train after a fire breaks out. Police arrested a 24-year-old man on charges of attempted murder. (Video provided by a passenger whose Twitter account is @siz33)

The man arrested over a stabbing rampage on a Keio Line train in Tokyo on Oct. 31 was dressed in a purple Joker costume and said he chose to carry out his attack on Halloween, according to police.

He said he was inspired by the Batman comic book villain as well as by a previous train attack in Tokyo, according to sources.

The Metropolitan Police Department on Oct. 31 arrested Kyota Hattori, 24, whose address and employment status are unknown, on charges of attempted murder.

“I lost my job and became bone-tired. I wanted to kill two or more people so I would be executed,” Hattori told police, according to investigative sources.

Hattori also reportedly gave a reason for why he attacked people on a train.

“Because it was Halloween, I thought it would be packed with many people,” police sources said.

According to police, Hattori stabbed a man in his 70s in his right chest with a knife at around 8 p.m. on Oct. 31 in a train operated by Keio Corp.

The man is in critical condition and remains unconscious.

Hattori used a Western-style knife with a roughly 30-centimeter blade. He said he purchased it on Amazon, according to sources.

Hattori and the victim were not personally acquainted, the sources said.

Immediately after he stabbed the man, Hattori appeared to splash oil around the train car and set it ablaze, which filled the train with smoke.

According to police, 16 male and female passengers in ages ranging from 10 to 69 suffered mild injuries from inhaling the smoke and being attacked with the liquid.

The 10-car train was on a limited express schedule. It had departed from Keio-hachioji and was bound for Shinjuku.

Hattori told investigators that he had “visited Shibuya, which had become crowded with Halloween” revelers, before the attack because he was “interested in Halloween,” according to police.

“I was exhausted,” he also said.

Based on his statement and security camera footage, police believe Hattori traveled to Chofu Station in Chofu, western Tokyo, by taking the Keio-Inokashira Line and the Keio Line.

Police said Hattori boarded a limited express train at the station, and shortly after it departed, Hattori stabbed the man who was sitting in the eighth car from the front of the train.

He then moved to the sixth car from the front and set the seats on fire.

The train made an emergency stop at Kokuryo Station in Chofu, where police officers who rushed to the scene overpowered Hattori and arrested him.

Hattori was wearing a purple suit when he was arrested. He told investigators that it was a Halloween costume of the Joker.

“Joker is so comfortable with murdering people that I have admired him,” Hattori said, according to police.

He told police that he had purposefully chosen to purchase the costume to wear on that day.

According to the Tokyo Fire Department, some of the passenger seats had burned in the sixth car, where the fire was started.

Sources said police found a 2-liter plastic bottle at the scene, which appeared to contain an oil-like substance.

In a backpack left at the scene, investigators found three to four plastic bottles containing transparent liquid and several pesticides.

Hattori told investigators that he was inspired by a similar stabbing rampage that occurred in August on an Odakyu Line train.

In that incident, a man stabbed passengers and injured 10 people.

Hattori said he targeted a limited express train because “it stops at fewer stations.”

Hattori mentioned a report that said the man arrested in the Odakyu Line incident had splashed salad oil about so he could light a fire.

“I heard that (the suspect) had trouble with salad oil and couldn’t set it ablaze. So, I splashed lighter fluid around and started a fire,” he told investigators, sources said.

Passengers climb through the windows to escape from a Keio Line train, which made an emergency stop at Kokuryo Station in Chofu, western Tokyo, on Oct. 31. (Provided by a passenger)

The train failed to line up properly with the platform when it made an emergency stop at Kokuryo Station. Because of that, the train doors and the safety doors on the platform did not open, forcing fearful passengers to climb out through the windows.

According to the train company and the transport ministry, passengers set off an emergency alarm system equipped in the train cars that notified of an incident after the train had departed Chofu Station.

The driver slowed the train to stop at Kokuryo Station, where the limited express train was not scheduled to stop.

But passengers used an emergency device that allowed them to manually open the train car doors.

The driver further decelerated and then stopped the train, but it stopped 2-3 meters away from the designated stopping positions, which prevented the train car doors and the platform doors from opening.

The doors can be manually opened, but the station staff decided not to do so because of the risk that passengers could fall out of the train and onto the tracks.

There were no security cameras installed in the train cars. It was only after the train stopped that staff had learned that a man brandishing a blade was on board.

The train driver picked up a shield stored in the driver’s compartment and rushed to the scene. The conductor helped police officers rush inside the train.

The transport ministry instructed railway companies nationwide on Nov. 1 to thoroughly implement measures to secure passenger safety.