YILAN, Taiwan: Taiwan President Tsai Ing-wen offered words of comfort and encouragement on Monday (Oct 22) as she met relatives of the 18 dead and 187 injured after a train derailed in the island's northeast, its worst such disaster in more than three decades.

Officials said four carriages overturned on Sunday after all eight cars of a train carrying 366 passengers left the tracks on a bend near a railway station in Yilan county, about 40km from Taipei, the island's capital.

Tsai joined Buddhist monks in prayer before an altar adorned with flowers next to a hospital, while nearby, relatives and friends of the victims wept as they sifted through battered suitcases recovered from the train wreck.

"We are really sorry ... you have to stay strong," Tsai told Chen Yu-chan, 41, whose only daughter, a seventh grader, was killed.

"We will do everything we can," she told another person, who was sobbing bitterly during her visit to the hospital.

Health authorities appealed for blood donations to help treat the many injured people, who included one foreigner, an American. Six of the dead were under 18, officials said.

The disaster was Taiwan's deadliest rail accident since a 1981 collision that killed 30 people, the official Central News Agency said.

The head of the state railway administration, Lu Jie-shen, had offered to resign but the transport minister did not accept the offer, the news agency reported.

Train services resumed early on Monday, after all the derailed carriages had been moved to one side of the tracks.

Authorities have set up an investigation committee and said they were trying to determine the cause of the accident, which remains unclear.

Many of the casualties happened in a carriage at the front of the train, said one official, adding that the driver, surnamed You, has been moved out of intensive care, though his condition was still unstable.

"We will ask him what happened after he stabilises," said Liu Can-huang, head of the car maintenance unit of the railways.

The train recorder, which tracks speed, among other data, had been sent to prosecutors to be examined, he added.

The derailment was not expected to cause a major disruption to economic activity, however.

BRIDE IN MOURNING

Tung Xiao-ling, 43, sobbed as she told reporters how she had lost eight of 17 family members, aged nine to 67, as they returned from celebrating her sister's wedding.

"No one can accept that one day you are a bride and the next day you are mourning a family member," said Tung, who was not on board the train.

"I hope they find out what happened as soon as possible. We trusted the safety of Puyuma," she said, referring to the express train line.

The fastest of Taiwan's regular trains, the Puyuma Express began operating in 2013 to negotiate the rough terrain of the east coast.

Hundreds of rescuers and military worked through the night, using spotlights to search the wreckage for survivors, as ambulances waited to take the injured to hospital.

Some rescue workers gave first aid to the injured, while others used cranes to lift some of the battered cars sprawled in a zigzag near the tracks.

"The train was going very fast. I thought to myself: Why was it not slowing down on a curve?" said Henry Tseng, who was riding one of the overturned carriages and suffered eye injuries.

"I hit a wall when the car started to flip," added the 30-year-old Tseng. "Around five to six people were thrown out of the carriage door...There's no time to think what happened. Everyone was in a rush to get out."

On Monday, Chen Tai-liang, whose niece, a seventh grader, was killed, said, "This is something that is not supposed to happen when taking a train."