A train flew off the tracks as it reportedly tore at twice the speed limit around a bend in northwest Spain, killing at least 78 passengers and injuring more than 140 in the nation's deadliest rail disaster since 1944.
Carriages piled into each other and overturned in the accident late Wednesday, smoke billowing from the wreckage of mangled steel and smashed windows as bodies were lain out under blankets along the tracks.
State railway company Renfe said it was too early to determine the cause but several media outlets said the train carrying 218 passengers and four crew was speeding.
It came off the tracks on a curve at 8:42 pm (1842 GMT) on Wednesday as it was about to enter Santiago de Compostela station in the northwestern region of Galicia.
One of the drivers who became trapped in the cab of the train after the accident told railway officials by radio shortly after the crash that the train had taken the curve at 190 kilometres per hour (118mph), unidentified investigation sources told El Pais newspaper.
The speed limit on that section of track is 80km/h.
"I was going at 190! I hope no one died because it will weigh on my conscience," he said, according to the online edition of the newspaper.
The eight carriages of the train derailed on a stretch of high-speed track about four kilometres from the station in the city, the destination of the famous El Camino de Santiago pilgrimage which has been followed by Christians since the Middle Ages.
The train was the Alvia model which is able to adapt between high-speed and normal tracks.
It had left Madrid and was heading for the ship-building coastal town of Ferrol as the Galicia region was preparing celebrations in honour of its patron saint James.
Prime Minister Mariano Rajoy, a native of Santiago de Compostela, arrived at the scene of the accident before visiting victims in hospital on Thursday.
Rajoy declared three days of mourning, while King Juan Carlos and Crown Prince Felipe called off their public engagements out of respect for the victims.
Several witnesses spoke of a loud explosion at the time of the accident.
"I was at home and I heard something like a clap of thunder, It was very loud and there was lots of smoke," said 62-year-old Maria Teresa Ramos, who lived just metres from where the accident happened.
"It's a disaster, people are crying out. Nobody has ever seen anything like this," she added.
Rescue workers recovered 73 bodies from the train's wreckage and four more victims died later in hospital, a spokesman for the Galicia high court said.
Provincial officials later said the toll had risen by one to 78 fatalities.
More than 140 people were also said to have various injuries.
It marks the worst rail accident in Spain since 1944, when hundreds were killed in a train collision, also between Madrid and Galicia.
Renfe said the train had no technical problems and had just passed an inspection on the morning of the accident.
"To put it in another way, the maintenance record and control of the train was perfect," Renfe head Julio Gomez-Pomar Rodriguez told Cadena Cope radio.
The cause was unknown, Renfe said.
"There is an investigation underway and we have to wait. We will know what the speed is very soon when we consult the train's black box," a Renfe spokesman said.
Francisco Otero, 39, who was inside his parents' home just beside the section of the track where the accident happened, said he "heard a huge bang".
"The first thing I saw was the body of a woman. I had never seen a corpse before. But above all what caught my attention was that there was a lot of silence, some smoke and a small fire," he told AFP.
"My neighbours tried to pull out people who were trapped inside the carriages with the help of pickaxes and sledgehammers and they eventually got them out with a hand saw. It was unreal."
Emergency services workers in red jackets tended to injured passengers lying on a patch of grass as ambulance sirens wailed in the background.
"There are bodies laying on the railway track. It's a Dante-esque scene," Alberto Nunez Feijoo, president of the regional government, told news radio Cadena Ser.
The town hall of Santiago de Compostela called off concerts and firework displays that had been planned as part of the festivities in honour of its patron saint.
Pope Francis called for prayers for the victims, as France, Poland, Italy and the European Union sent their condolences.
The accident in Spain marks the third large rail disaster this month after six people died in a passenger train derailment near Paris on July 12, and 47 were killed when an oil train derailed and exploded in Canada on July 6.