© Reuters/KyodoA passenger on the stretcher is carried by rescue workers from a Shinkansen bullet train after it made an emergency stop in Odawara, south of Tokyo, in this aerial view photo taken by Kyodo June 30, 2015
A man has set himself on fire on a bullet train bound for the western city of Osaka from Tokyo, Japanese officials confirmed, adding that two people are were killed and at least 26 injured.

According to local media, a man poured an oil-like liquid over his head and attempted self-immolation in the train that was carrying about 1,000 passengers.

"At the very front of the first carriage ... this person had a whole petrol container, and sprayed liquid across the seats ... and then all over himself. And then set himself on fire," a woman passenger told TBS broadcaster. "And fire spread all over the place immediately."

The fire department of Odawara in the Kanagawa Prefecture said that the man and a female passenger died on the train, while two other people were injured, the Japan Times reports. The woman reportedly died from inhaling smoke.

"We received information indicating that a fire broke out near a toilet and two people were in cardiopulmonary arrest," a spokesman for the Odawara Fire Department said.

At least 26 other passengers were also hurt in the incident due to heat, smoke and other causes, according to fire department officials.

Television footage showed people being evacuated from the train, which stopped in a residential area. Several people were carried out of the train on stretchers.

Bullet trains, called Shinkansen, travel at a speed of up to 320km/h and have been widely regarded as a safe way of traveling. Many thousands of Japanese people use them for commuting daily.