At least 80 people were killed and 130 injured when a train derailed near the northern Spanish city of Santiago de Compostela, in one of Europe's worst rail disasters.

Bodies covered in blankets lay next to the overturned carriages, as smoke billowed from the wreckage after the Wednesday crash. Firemen clambered over the twisted metal trying to get survivors out of the windows.

Four carriages overturned. Images showed one pointing into the air with one of its ends twisted and disfigured. Another carriage that had been severed in two was lying on a road near the track.

Authorities said that at least 80 people were dead, and 130 injured, many seriously. The head of Spain's Galicia region, Alberto Nunez Feijoo, said: "The scene is shocking, it's Dante-esque."

The train was carrying 247 people and was travelling from Madrid to Ferrol on the Galician coast when it derailed, train operator Renfe said.

A Spanish court has said that the driver of the derailed train has been put under investigation.

Witness accounts

A witness told radio Cadena that carriages overturned several times on a bend and came to a halt piled up on each other.

"It was going so quickly ... It seems that on a curve the train started to twist, and the wagons piled up one on top of the other," passenger Ricardo Montesco told the station.

"A lot of people were squashed on the bottom. We tried to squeeze out of the bottom of the wagons to get out and we realised the train was burning ... I was in the second wagon and there was fire ... I saw corpses."

Another witness told the station they had heard an explosion before seeing the derailed train.

The government said it believed the derailment was an accident - though the scene will stir memories of 2004's Madrid train bombing that killed 191 people.

Santiago de Compostela is the birthplace of Spanish Prime Minister Mariano Rajoy and is best known as the destination of an ancient Catholic pilgrimage route.

After visiting victims of the crash in hospital, Rajoy declared seven days of mourning in a televised speech.

He also announced investigations into the cause of the accident and said that he gave "instructions" to authorities to get "traffick on the railways back to normal".

The crash happened a day before the city's main festival focused on St James, one of Jesus's 12 disciples whose remains are said to rest in the city. Tens of thousands of pilgrims attend the festival.

Pope Francis, who is visiting Brazil, called for prayers for those killed in the crash. "He joins the families in their sorrow and calls for prayers ... in this tragic event," Vatican spokesman Federico Lombardi said.