A man was arrested for attempted murder after a knife and fire attack on a train in Tokyo on Sunday, Japanese media said, with at least 17 people reportedly injured and one in a serious condition after being stabbed.

Eyewitnesses told national broadcaster NHK of their fear during the attack that took place on Halloween when the Japanese capital is full of revellers, many in costume.

Media outlets said the alleged perpetrator in his 20s -- wearing a green shirt and indigo suit -- attacked people with a knife and started a fire on the train.

A video clip published by public broadcaster NHK showed panicked passengers running down the train as smoke filled the carriage, with flames also visible.

Another video posted on Twitter showed people climbing through windows to escape the Keio Line train at a station.

The line operator said services had been partially suspended after "an incident involving injuries" took place just before 8 pm near Kokuryo in the Japanese capital's western suburbs.

Media outlets including NHK said the alleged perpetrator attacked people with a knife and started a fire on the train. The method was unclear but reports also said the man had spread a liquid around the train carriage.

The attacker carried out the act without showing any emotion, a female passenger said.

"He held a knife and started spreading liquid," she said. "He was committing this act without showing any emotion, just mechanically. I think that brought fear to everyone."

"First I thought it was something like a Halloween event. But I rushed away as a man carrying a long knife came in. I was very fortunate not to be injured," a man in his 20s who was on the train told NHK.

Kyodo News said 15 people had been injured in the attack, with NHK reporting at least 10 were hurt with a man in his 60s in serious condition.

Local police officials could not immediately be reached for comment.

Violent crime is rare in Japan, but in August nine people were wounded, one of them seriously, in a stabbing attack on a commuter train in Tokyo, with the suspect later handing himself in after fleeing the scene.

In a separate attack in August, two people suffered burns in an acid attack at a Tokyo subway station.

Japan has strict gun laws, but there are occasional violent crimes involving other weapons.

In 2019, a man killed two people including a schoolgirl and wounded more than a dozen in a rampage that targeted children as they waited for a bus.

And in 2018, a man was arrested in central Japan after stabbing one person to death and injuring two others aboard a bullet train.