A commuter train caught fire Sunday afternoon in Tokyo after being stopped next to a building along the tracks that was ablaze, forcing some 300 passengers to evacuate.

No one was hurt in the incident that occurred on the Odawara Line operated by Odakyu Electric Railway Co. between Sangubashi and Yoyogi-hachiman stations, but about 71,000 people were affected by subsequent delays.

On Monday, the police inspected the fire site, a three-story building housing a boxing gym, to investigate the cause of the blaze. Police said the fire may have broken out on the third floor, where the gym is a tenant, given that a person connected to the gym has acknowledged smoking on the floor.

Some passengers said they were unaware that the train had caught fire until they came out of the cars. "I was scared. It was good that I was able to evacuate," a passenger said.

"The car was filled with smoke and I felt it was getting hot," said Katsumi Tokuyama, a 39-year-old Tokyo resident who was on board the train. "When I saw the footage later I was surprised that the blaze was much more intense than I had thought," he added.

 Odakyu train fire (Supplied by Passenger XXXMasamiXXX Tokuyama)

(Katsumi Tokuyama)

(A passenger)

Riko Kinefuchi, a 16-year-old high school student, saw a burning building on her left side when the train stopped. She was in the third car and eventually smelled smoke.

It took about 30 minutes to complete the evacuation after the emergency stop between Sangubashi and Yoyogi-hachiman stations. But many passengers were calm and walked to a crossing without any chaos, according to Kinefuchi.

A police officer had pressed an emergency button at a crossing near where firefighters were tackling the burning three-story building in Tokyo's Shibuya Ward, meaning the train was automatically brought to a halt opposite it.

The roof of the train, which was inbound to Shinjuku Station, caught fire at around 4:05 p.m. Sunday, producing black smoke.

The driver started to move the train to ensure safety but halted it again after about 120 meters after being notified by firefighters about the fire on the roof.

 Odakyu train fire (Supplied Image)

(Supplied Image)

The passengers were guided by train crew to leave the train from the front and rear cars. Odakyu is investigating whether its response when the train stopped and its evacuation measure were appropriate.

According to the operator, the body of the train is made of stainless steel and immune to catching fire. But part of the train's roof is covered with urethane resin, which plays the role of an insulator, to protect it from overhead wires with high-voltage current.

Although fire-retardant material is mixed in the resin, it could still catch fire, Odakyu said.

About 25 fire engines were dispatched to attend the building fire and blaze on the roof of the second carriage of the eight-car train. The fires were put out after about one hour and 45 minutes.

On Monday, the police inspected the fire site to investigate the cause of the blaze.

The three-story building houses a boxing gym and the police believe the fire broke out from the upper level, possibly due to smoking.