One of the drivers of a Spanish train that hurtled off the rails at high speed, killing at least 80 passengers in the nation's worst such disaster in decades, was to be grilled by police, a regional court said Thursday.

The driver, lightly injured, "would be questioned by police in hospital where he has been placed under surveillance," the High Court in Galicia said in a statement, adding that no arrest has been ordered at this stage.

The questioning, initially expected on Thursday, had not taken place by the end of the day, according to a police source, meaning it could occur on Friday.

State railway company Renfe said it was too early to determine the cause of the tragedy but several media outlets said the train was going at twice the speed limit when it crashed near the northwestern town of Santiago de Compostela late Wednesday.

Prime Minister Mariano Rajoy, a native of the town, called it the "saddest" day and announced the launch of two probes into the accident as well as declaring three days of national mourning.

A local government official in the Galicia region said there were 80 confirmed dead, making it the deadliest rail accident since 1944 when hundreds were killed in a train collision, also between Madrid and Galicia.

Another 178 were injured, including 94 who remain in hospital, regional health minister Rocio Mosquera said, warning that the death toll could rise further.

Thirty-two of the injured were in critical condition, including four children.

The US Department of State confirmed that at least one American had died and five others had been injured in the crash.

President Barack Obama was "shocked and saddened" over the "tragic train derailment", he said in a statement.

Renfe had said there were 218 passengers and four crew on the train but the casualty toll provided by the regional government indicated there were over 250 people on board.

The train flew off the tracks and flipped on to its side as it was travelling from Madrid to the port town of Ferrol, with carriages slamming into each other as it approached the pilgrimage centre of Santiago de Compostela.

Smoke still billowed from the wreckage of mangled steel and smashed windows on Thursday as bodies were laid out under blankets along the tracks.

King Juan Carlos, who called off public engagements to visit victims in the hospital where the majority of the injured are being treated, said that "all Spaniards would be united by the pain suffered by the victims' families."

-- 'Like a clap of thunder' --

One of the drivers who became trapped in the cab after the accident told railway officials by radio that the train had taken the bend at 190 kilometres (118 miles) an hour, unidentified investigators told El Pais newspaper.

The speed limit on that section of track is 80 kilometres an hour.

"I hope no one died because it will weigh on my conscience," said the driver, according to the paper's online edition.

A judge has asked that the driver to be questioned in the hospital where he is being treated. He "will be assisted by a lawyer" during the questioning, a court spokeswoman said.

The train's data recording "black box" and other documents are now with the judge in charge of the investigation, the court statement added.

A security video taken at the moment of the accident shows the train negotiating a curve before a number of carriages come off the rails and drag the rest off with them.

Several witnesses spoke of a loud explosion.

"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 lives just metres (yards) from the site.

"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," said Francisco Otero, 39, who was visiting his parents.

Renfe said the train had no technical problems and had just passed an inspection on the morning of the accident.

"The objective is to determine as soon as possible what caused this accident," Rajoy said announcing the launch of investigations by the judiciary and a rail commission.

-- Disaster near famous pilgrimage town --

The train derailed on a stretch of high-speed track about four kilometres from the station in the city, which was hosting the famous El Camino de Santiago pilgrimage followed by Christians since the Middle Ages.

Under the towering stone arches in the town's cathedral, hundreds of worshippers held a mournful mass and prayed for the victims.

The town hall has called off concerts and firework displays that had been planned as part of the festivities in honour of its patron saint.

The images of the wrecked carriages stirred memories of the 2004 Madrid train bombings by Islamic extremists which killed 191 people.

However, officials have ruled out terrorism as a cause of Wednesday's tragedy.

In 1972, 77 people were killed when a train linking Cadiz and Seville in the southwest derailed.

The accident in Spain is 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.