Pictures from inside the commuter train show how travelers escape through the carriages.

Shortly afterwards, large flames appear to be extinguished - all while the train is still rolling.

Tokyo police say the attack occurred on the Keio train near Kokuryo station.

According to witnesses, the perpetrator was dressed as the character The Joker in Batman and after the knife attacks was seen pouring out an oil-like liquid before he lit a fire.

- I thought it was a Halloween stunt, says a witness for the newspaper Yomiuri when he saw passengers coming running in the train.

- Then I saw a man coming walking while he slowly swung a large knife.

The perpetrator, a 24-year-old man, could be arrested at the next station and is now being investigated on suspicion of attempted murder.

The motive is still unknown, but local media reports that he has stated that he "wanted to kill people in order to be sentenced to death", writes Reuters.

This is the second time in two months that a knife attack has occurred on a commuter train in Tokyo.

In August, ten people were stabbed by a man who stated in interrogation that he wanted to attack women who looked happy.