* Derailment caused by excessive speed - source
* Tragedy on eve of major religious festival
* One of Europe's worst rail disasters
By Teresa Medrano and Tracy Rucinski
SANTIAGO DE COMPOSTELA, Spain, July 25 (Reuters) - The driver of a Spanish train that derailed, killing at least 80 people, was under police guard in hospital on Thursday after the dramatic accident which an official source said was caused by excessive speed.
The eight-carriage train came off the tracks, hit a wall and caught fire just outside the pilgrimage destination Santiago de Compostela in northwestern Spain on Wednesday night. It was one of Europe's worst rail disasters.
The source had knowledge of the official investigation into a crash which brought misery to Santiago on Thursday, the day when it should have celebrated one of Europe's biggest Christian festivals. Authorities cancelled festivities as the city went into mourning.
The Galicia regional supreme court said in a statement the judge investigating the accident had ordered police to take a statement from the driver.
He was being formally investigated and under police guard but not under arrest, the court said. He was in hospital but it was not clear what kind of injuries he had suffered.
Video footage from a security camera showed the train, with 247 people on board, hurtling into a concrete wall at the side of the track as carriages jack-knifed and the engine overturned.
One local official described the aftermath of the crash as like a scene from hell, with bodies strewn next to the tracks.
The impact was so huge one carriage flew several metres into the air and landed on the other side of a high concrete barrier.
Around 94 people were injured, 35 of them, including four children, in a serious condition, the deputy head of the regional government said.
"We heard a massive noise and we went down the tracks. I helped get a few injured and bodies out of the train. I went into one of the cars but I'd rather not tell you what I saw there," Ricardo Martinez, a 47-year old baker from Santiago de Compostela, told Reuters.
Newspaper accounts cited witnesses as saying the driver, Francisco Jose Garzon, who had helped rescue victims, shouted into a phone: "I've derailed! What do I do?".
The 52-year-old had been a train driver for 30 years, said a spokeswoman for Renfe, the state train company.
A court source told Reuters there was one driver on the train. Previously, a Galicia government source had said there were two.
TRAIN HIT BEND AT SPEED
El Pais newspaper said the driver told the railway station by radio after being trapped in his cabin that the train entered the bend at 190 kilometres per hour (120 mph). An official source said the speed limit on that stretch of twin track, laid in 2011, was 80 kph.
"We're only human! We're only human!" the driver told the station, the newspaper said, citing sources close to the investigation. "I hope there are no dead, because this will weigh on my conscience."
Investigators were trying to find out why the train was going so fast and why security devices to keep speed within permitted limits had not slowed the train.
Operated by state-owned company Renfe, the train was built by Bombardier and Talgo and was around five years old. It had almost the maximum number of passengers.
Spain's rail safety record is better than the European average, ranking 18th out of 27 countries in terms of railway deaths per kilometres travelled, the European Railway Agency said. There were 218 train accidents in Spain between 2008-2011, well below the EU average of 426 for the same period.
Firefighters called off a strike to help with the disaster, while hospital staff, many operating on reduced salaries because of spending cuts in recession-hit Spain, worked overtime to tend the injured.
The disaster happened at 8.41 p.m. (1841 GMT) on the eve of a festival dedicated to St. James, one of Jesus's 12 disciples, whose remains are said to rest in Santiago's centuries-old cathedral.
The apostle's shrine is the destination of the famous El Camino de Santiago pilgrimage across the Pyrenees, which has been followed by Christians since the Middle Ages.
"The main mass (in the cathedral) was transformed from a mass of joy into a mass of mourning," said Italian pilgrim Irene Valsangiacomo.
KING, PM VISIT
One U.S. citizen died in the crash and five were injured, the State Department said in Washington. Mexico said one of its nationals was among the dead.
At least one British citizen was injured, a British embassy spokesman said. People from several other countries were believed to be among the passengers.
People living nearby ran to the site to help emergency workers tend to the wounded. Ana Taboada, a 29-year-old hospital worker, was one of the first on the scene.
"When the dust lifted I saw corpses. I didn't make it down to the track, because I was helping the passengers that were coming up the embankment," she told Reuters. "I saw a man trying to break a window with a stone to help those inside get out."
Prime Minister Mariano Rajoy, who was born in Santiago de Compostela, the capital of Galicia region, visited the site and the main hospital on Thursday. He declared three days of official national mourning for the victims of the disaster.
King Juan Carlos and Queen Sofia also went to Santiago and visited the injured in hospital.
"All of Spain is united in grief with the bereaved families," the king said.
Both Renfe and state-owned Adif, which is in charge of the tracks, opened an investigation into the derailment.
Passenger Ricardo Montesco told Cadena Ser radio station the train approached the curve at high speed, twisted and the carriages piled up one on top of the other.
"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 carriage and there was fire. ... I saw corpses," he said.
Clinics in Santiago de Compostela were overwhelmed with people flocking to give blood, while hotels organised free rooms for relatives. Madrid sent forensic scientists and hospital staff to the scene on special flights.
Allianz Seguros, owned by Germany's Allianz, owns the insurance contract for loss suffered by Renfe passengers, a company spokeswoman told Reuters. The contract does not cover Renfe's trains. The company had sent experts to the scene.
The disaster stirred memories of a train bombing in Madrid in 2004, carried out by Islamist militants, that killed 191 people, although officials do not suspect an attack this time.
Spain is struggling to emerge from a long-running recession marked by government-driven austerity to bring its deeply indebted finances into order.
But Adif, the state railways infrastructure company, told Reuters no budget cuts had been implemented on maintenance of the line, which connects La Coruna, Santiago de Compostela and Ourense and was inaugurated in 2011.
It said more than 100 million euros a year were being spent on track maintenance in Spain.