Media playback is unsupported on your device Media caption The Puyuma Express 6432 service came off the tracks close to Xinma station

At least 18 people have been killed and 187 injured after a passenger train derailed in north-east Taiwan.

Railway authorities say they are investigating the accident, which happened in Yilan County at about 16:50 local time (08:50 GMT) on Sunday.

A total of 366 passengers were on the train when all eight of its carriages derailed.

The incident is Taiwan's worst rail accident in 27 years. At least three children were among the dead.

"The train was going very fast. I hit a wall when the car started to flip. Around five to six people were thrown out of the carriage door," passenger Henry Tseng told Reuters news agency.

"There [was] no time to think what happened. Everyone was in a rush to get out."

It is not clear if any passengers remain unaccounted for - with reports providing conflicting details.

'Overturned at 90 degrees'

The Puyuma Express 6432 service came off the tracks close to Xinma station, near the town of Su'ao about 70km (43 miles) from Taipei.

It was travelling between Taipei and the eastern county of Taitung.

"There are four carriages that were overturned at 90 degrees and the worst casualties were in those carriages," said Jackson Lu, director-general of the Taiwan Railways Administration (TRA).

He had earlier told a press conference that the train was only six years old and had been in "pretty good condition" before the accident.

It remains unclear what caused the train to derail, but witnesses told local media they heard a loud noise then sparks and smoke.

Video footage on local television showed passengers breaking windows to escape the carriages.

"I smashed the safety glass and crawled out and I helped to pull a young man out," one passenger told reporters. "There was a person sitting behind me. I'm not sure she survived."

Image copyright AFP Image caption Authorities say five of the train's eight carriages ended up on their side

Another woman, Tung Xiao-ling, lost eight family members who had been returning from her sister's wedding celebration.

"No one can accept that one day you are a bride and the next day you are mourning a family member," Ms Tung, who was not onboard, told Reuters.

An AFP news agency reporter at the scene said more bodies were being removed from the damaged carriages at about 20:00 local time (12:00 GMT) on Sunday night.

Photographs from the scene show seats upended, with parts of the railway tracks twisted through carriage windows in places.

Image copyright AFP Image caption Tsai Ing-wen has asked for a speedy investigation

Taiwan's leader, Tsai Ing-wen, arrived in Xinma on Monday morning. She said she had "asked prosecutors to clarify the situation" and quickly determine what caused the derailment.

She also met relatives of passengers affected by the disaster.

"We are really sorry... you have to stay strong," Ms Tsai told the mother of a seventh-grade girl who was killed in the crash.

Taiwan has an extensive train network and more than half a million passengers travel on the system every day.