(ChannelNewsAsia) - Forty-one people were killed and 39 others injured when a metro train derailed in a tunnel in the eastern Spanish city of Valencia as pilgrims gathered ahead of a papal visit, officials said.
An interior ministry spokesman said any terrorist link had been "completely ruled out".
"Everything indicates that it was an accident, that the train derailed and was hurled against the walls of a tunnel," the spokesman told AFP.
Spanish commuters well remember the train bombings by Islamist militants that killed 191 people in Madrid in 2004.
Regional transport chief Jose Ramon Garcia Anton warned that speculation about the cause of the crash would be premature until the train's black box recording was found.
"We have to be prudent and wait for the enquiry to uncover the causes of the accident," he said.
Monday's derailment happened at 1:00 pm (1100 GMT) as the train was between the Jesus and Plaza de Espana stations.
In one of the worst metro accidents in the past 50 years, a fire brigade spokesman said that two carriages of the train had come off the rails in a tunnel.
The spokesman said rescue services had evacuated all the survivors from the train.
"It seems it was an accident that was apparently brought about by speed and a failure at the wheel level," said local deputy prefect Luis Felipe Martinez.
"41 people are dead including the driver and ticket inspector," said Mikel Dominguez, security advisor to the city of Valencia.
The search for victims was ended after midnight, he added.
Of the 39 injured, 12 remained in hospital, he added, with two in "very critical" condition.
One of the injured was said to be a pregnant woman whose wounds were said to be life-threatening.
"There was a collision, strange noises, then nothing," one of the train passengers told local radio. He managed to escape through a window as rescue workers turned up.
Prime Minister Jose Rodriquez Zapatero cut short a visit to India to travel to Valencia, officials said.
"My thoughts are with the town of Valencia... and I express my condolences with the victims of this tragedy," he said in New Delhi.
Zapatero was to attend a funeral service here on Tuesday evening.
A passenger on board alerted emergency services at 1:03 pm (1103 GMT). Access to the area was sealed off and a security cordon installed.
The accident happened as Valencia was filling up with visitors to the Roman Catholic Church's fifth World Family Meeting this week, which is due to be closed by Pope Benedict XVI at the weekend.
The Vatican said the pope had been immediately informed and had prayed for the victims of the accident.
"The Holy Father was immediately informed of the tragic accident in Valencia and has followed with pain and compassion the dramatic news coming out of the town. He has prayed for the victims, their families and all those affected by this terrible event," the Vatican said in a statement.
According to the Valencia metro website, the regional government-run company was distributing half-a-million passes to pilgrims and organisers of the event to permit them to travel freely on the system's four lines.
The European Parliament observed a minute's silence following news of the accident, and the European Commission President Jose Manuel Durao Barroso expressed his "solidarity with the people of Valencia".
Overnight technicians worked on righting and removing the train wreckage.
The victims' bodies were taken away for identification and a team of 15 psychologists rushed in to help the bereaved and traumatised.
Some 500 people turned up searching for loved ones with no official victim list yet published.
The same train line was the scene of a crash last September which left 35 people injured. The Valencia metro opened in 1988.
The worst metro accident in recent history was in 1995 in Azerbaijan, when 290 people were killed and more than 270 injured after a fire on board a train between two stations in the capital Baku.