"All Spaniards, we are united at this time. ... Really all Spaniards join in the pain of the families of the dead," he said. "We hope that the wounded will recover, little by little."
The royal family canceled all events scheduled for the day out of respect for the day of mourning, the royal household told CNN.
Alberto Nunez Feijoo, head of the regional government in Galicia, declared seven days of mourning in the region for victims of the tragedy.
In a speech, he said "all of the community cries about the tragedy that we are living, we cry for the victims, we cry for the unease and sadness of the families."
Spanish Prime Minister Mariano Rajoy viewed the scene of devastation Thursday morning and visited some of the hospitalized crash victims.
Rajoy, who is from the area, told a news conference there was a "huge challenge" ahead, not least in identifying all those killed and informing their families, and he praised the response of everyone who has helped after the crash.
Two investigations are under way, he said, adding, "We want to establish what happened."
Rajoy declared three days of national mourning to honor the victims of the crash.
The prime minister came under fire in Spanish media after a condolences message for the train crash victims posted by his office late Wednesday included a paragraph apparently "copied and pasted" from a statement previously sent to victims of an earthquake in Gansu, China.
''I would like to express my deepest condolences for the loss of human lives and the material damage from the earthquake that has occurred in Gansu has caused," the note said.
Victim: 'Everything went dark'
One victim, speaking from a hospital bed with his arm in a sling, told CNN affiliate Atlas that it seemed like train was going fast.
"But we didn't know what was the maximum speed, so I thought it was normal," he said, "And suddenly there was a curve, the suitcases fell, and everything went dark. And I hit my head a ton of times, and 10 seconds later I was wedged between seats, and I had people's legs on top of me."
As he waited for rescuers to pull him from the wreckage, he heard other passengers yelling.
"I heard little children screaming. ... I also heard two girls that yelled out, one supporting the other," he said.
Through the darkness, passenger Stephen Ward saw a little circle of light -- the door of the train.
Rescuers came through it and helped the 18-year-old from Bountiful, Utah, get out.
He waited for hours while victims with more serious injuries were taken to the hospital. As he watched rescue crews carry the dead and wounded, he cried and sang church hymns to calm himself down.
A photo taken at the scene shows him leaning on a police officer as he walked beside the tracks, with blood oozing down his face and splattered on his crisp, white shirt.
The Mormon missionary walked past dead bodies on the ground. He told London's Daily Telegraph that it looked like a scene from hell.
U.S. citizen among those killed
When the train crashed, Ana-Maria Cordoba was on the way with her husband and their daughter to visit her son, who had been on a pilgrimage in Spain, the Catholic Diocese of Arlington told CNN.
Cordoba, who worked for the diocese, was killed, spokesman Michael Donahue said.
Her husband and daughter are hospitalized in stable condition, the diocese said.