Heavy machinery is being used to assist in the recovery following a two-train crash in southern Spain which killed at least 41 people.

Rescuers worked through a second night as more bodies are feared to be trapped in the wreckage.

More than 120 people were injured when carriages on a Madrid-bound train derailed and crossed over to the opposite tracks, hitting an oncoming train in Adamuz on Sunday evening.

A faulty or damaged weld on a rail is being investigated as a factor in the crash, Spanish media report.

Prime Minister Pedro Sanchez has cancelled his planned trip to the World Economic Forum in Davos, pledging to get to the bottom of Spain's worst train disaster in more than a decade.

Spain's King Felipe and Queen Letizia will visit the site later on Tuesday.

Three days of national mourning have been announced.

Transport Minister Óscar Puente said the death toll is not yet final and that officials are working to identify the dead.

Spanish media report that a 30cm gap in one of the rails is the current focus of the investigation.

Technicians told the El Mundo newspaper that a bad or deteriorated weld was more than likely the cause for the derailment.

Four hundred passengers and staff were on board the two trains, with emergency services treating 122 people. Of those, 41, including children, were still in hospital, with 12 in intensive care.

Most of those killed and injured were in the front carriages of the Huelva-bound train, officials said.

Salvador Jimenez, a journalist with RTVE who was on one of the trains, described the crash as feeling like an earthquake and stated that the impact was significant enough to derail the train.