At least 39 people have died in a train collision in southern Spain and dozens more have been injured in the country's worst rail crash in more than a decade, Spain's Civil Guard has said.

Carriages on a Madrid-bound train derailed and crossed over to the opposite tracks, colliding with an oncoming train in Adamuz on Sunday evening.

Four hundred passengers and staff were onboard both trains, the rail networks said. Emergency services treated 122 people, with 43, including four children, still in hospital. Of those, 12 adults and one child are in intensive care.

Spanish Transport Minister Óscar Puente said the death toll is not yet final, as officials launched an investigation.

Puente described the incident as extremely strange. All the railway experts consulted by the government are extremely baffled by the accident, he told reporters in Madrid.

Rail network operator Adif said the collision happened at 19:45 local time (18:45 GMT), about an hour after the train left Málaga heading north to Madrid, when it derailed on a straight stretch of track near the city of Córdoba.

The force of the crash pushed the carriages of the second train into an embankment, with most of those killed and injured in the front carriages of the second train, which was travelling south from Madrid to Huelva.

Rescue teams faced challenges due to the twisted wreckage, making it difficult to recover people trapped inside the carriages.

A Madrid-bound passenger described the impact as feeling like an earthquake.

All rail services between Madrid and Andalusia were suspended, and an investigation into the crash is expected to take at least a month to determine the cause. Prime Minister Pedro Sánchez expressed condolences to victims' families and the nation as the country mourns the loss.

This incident marks a significant tragedy for Spain’s high-speed rail system, which is the second largest in the world.