At least 45 people were killed and dozens injured when a train derailed on the outskirts of the northern Spanish city of Santiago de Compostela.

The regional government said around 70 people were injured with over 20 seriously hurt.

Spain’s state rail company Renfe said the train was travelling from Madrid to Ferrol with 218 passengers and crew on board when it derailed.

Bodies covered in blankets lay next to carriages as smoke billowed from the wreckage a few hundred metres away from the entrance to the city's main station.

The train derailed on the eve of the ancient city's main Christian festival when thousands of pilgrims travel in to pack the streets.

"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," one passenger told Cadena Ser radio station.

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

The Spanish government's main working hypothesis concerning the derailment is that it was an accident.

But the crash will stir memories of 2004's Madrid train bombing that killed 191 people.

Spanish Prime Minister Mariano Rajoy was due to visit the site tomorrow morning.

A government spokeswoman said the Prime Minister and Deputy Prime Minister are in emergency session with the interior minister and public works minister.

The head of the surrounding Galicia region, Alberto Nunez Feijoo, said at least 45 people had died and it was too early to say what had caused the derailment.

The crash happened a day before the city's main festival paying tribute to the remains of St James, one of Jesus' 12 disciples.

The apostle's shrine in the city is the destination of the famous El Camino de Santiago pilgrimage, followed by Christians since the Middle Ages.

The city is also the birthplace of Mr Rajoy.

The Department of Foreign Affairs has said the Irish Embassy in Madrid is trying to establish whether any Irish people may have been caught up in the crash.