Regional authorities and a witness said the train was going too fast and one of its wheels broke into pieces, derailing the first car, which overturned. Victims were strewn in the tunnel. Officials did not say if the second car derailed.
Rescue workers hustled bloodied, sooty survivors from the tunnel. Anguished relatives cried out in grief and drew each other close as they waited outside the local morgue. The accident brought back memories of the 2004 terrorist attack on Madrid commuter trains that killed 191 people.
Prime Minister Jose Luis Rodriguez Zapatero cut short a visit to India. Pope Benedict XVI, who was to arrive in Valencia on Saturday for the Roman Catholic Church's World Meeting of the Families, prayed for the victims and "has followed with pain ... the dramatic reports," the Vatican said.
It was the second accident on Valencia's No. 1 line in less than a year. A September collision involving three trains injured at least 30 people, four of them seriously.
Jorge Alvarez, secretary-general of the Independent Railway Union, said it was too early to blame human error for Monday's tragedy. He said his union repeatedly warned of safety problems on Valencia's 18-year-old subway system, particularly the No. 1 line.
"The train began to go faster than usual and started to move from one side to the other," Cesar Hernandez Nunez, a 21-year-old student traveling in the second car, told the newspaper El Mundo. "Right after that it was chaos."
Vicente Rambla of the regional Interior Ministry said that Monday was "one of the saddest days for Valencia," a city of 800,000 on the country's east coast, some 220 miles from Madrid.
He said 12 of the 47 injured were hospitalized. Two of the injured were in critical condition, local media reported. The train's driver was not seriously hurt.
Some of the dead were still inside the carriage hours later, Rambla said.
The accident occurred around 1 p.m. as the train approached Jesus station on a curved section of the track, authorities said.
A woman who emerged unhurt from the subway told reporters she had been waiting for a train to arrive when she heard a very loud noise and saw sparks fly deep inside the tunnel, state news agency Efe reported.
The woman did not provide her name.
About 150 people were evacuated from the station, authorities said. Nunez said he was able to break open a door to leave the train.
"When I got to the track I noticed there were only two carriages. The first had overturned and mine was in a normal position," he said. "There were people on the ground. I couldn't think very much. I preferred to turn away."
Police cordoned off the area and a mobile medical unit was set up at the scene.
King Juan Carlos expressed his condolences and the European Parliament held a minute of silence for the victims.
Zapatero was to attend a Tuesday morning mass in Valencia.
More than 60 million people used Valencia's subway system in 2005, some 165,000 people a day, according to its Web site. The subway has four lines and 116 stations.
In June 2003, 19 people were killed and 48 injured in a head-on crash in central Spain. The crash, in which a passenger train collided with a freight train, occurred outside the station in Chinchilla.
On March 11, 2004, Islamic radicals bombed several commuter trains around Madrid, killing 191 people and injuring more than 1,500.