Train crash Santiago
The wreckage of a train crash near Santiago de Compostela, northwestern Spain (Reuters)

One of the drivers of a train that derailed in Spain killing at least 78 people has been placed under formal investigation.

Francisco José Garzón Amo reportedly told emergency services he was speeding when the eight-carriage train entered a curved stretch of track near Santiago de Compostela.

According to Spanish newspaper El Pais, Garzón Amo told rescuers that the train was travelling at about 190kph, twice the speed limit.

"We are humans, we are humans" the driver was quoted as saying. "I hope there are no fatalities as they weigh on my consciousness".

Garzón Amo, 52, has reportedly been working for the state-owned train operator Renfe for about 30 years. He is recovering at a Santiago hospital under police watch, El Pais claims.

Renfe president Julio Pomar said the train had no technical problems, telling Spanish radio: "The train had passed an inspection that same morning. Those trains are inspected every 7,500km. Its maintenance record was perfect."

Spanish Prime Minister Mariano Rajoy, who was born just a few miles from where the crash took place, has visited the site of the accident and declared three days of national mourning.

"Today is a very difficult day. Today we have lived through a terrible, dramatic accident, which I fear will stay with us for a long time" Rajoy said.

"For someone from Santiago, like myself, believe me, this is the saddest Day of St James of my life."

Earlier Rajoy was heavily criticised for sending a "cut and paste" message of condolence to the people of Galicia, which had been apparently used for earthquake victims in China.

Hospital officials said 141 people were injured and 36 of them, including four children, remained critical.

Authorities investigating the crash are examining the train's black box. Government officials said they believed it was an accident.

"We are moving away from the hypothesis of sabotage or attack," said one.

The moment the train came off the tracks in the northwestern Galicia region was captured on video by a security camera.