Speed will be a factor in the inquiry, as a security camera captured the train crashing as it hurtled round a bend.
Dozens of people were hurt, 32 seriously, in the incident near Santiago de Compostela.
Spain will hold three days of mourning over the crash, one of its worst.
King Juan Carlos visited survivors and the families of victims at Santiago's University Hospital.
"All Spaniards are united at this moment," he said.
Prime Minister Mariano Rajoy was at the scene of the crash earlier in the day.
The Madrid to Ferrol train's data recording "black box" is now with the judge in charge of the investigation.
Continue reading the main story
The 32 seriously injured include children.
People from several nationalities are among the wounded, including five Americans and one Briton. One American was among the dead.
Continue reading the main story
Spanish train crashes
- August 2006: Inter-city train derails in Villada, in the province of Palencia, killing six people and injuring dozens more
- July 2006: At least 43 people killed in a metro train crash in the Valencia area
- 1972: Andalusia crash leaves between 76 and 86 people dead.
- 1944: Hundreds believed dead after a crash in Torre del Bierzo, in Leon province - official account gave the figure as 78 killed.
Named by Spanish media as Francisco Jose Garzon Amo, he is expected to face questioning by police on Thursday.
It was unclear whether anyone else was subject to investigation.
The train's carriages have been removed from the track by cranes and sent for analysis.
The president of railway firm Renfe, Julio Gomez Pomar, was quoted by El Mundo newspaper as saying the driver, who was aged 52, had 30 years of experience with the company and had been operating trains on the line for more than a year.
He said the train which derailed had no technical problems.
"The train had passed an inspection that same morning. Those trains are inspected every 7,500km... Its maintenance record was perfect," he told Spanish radio.
But Mr Garzon, who was trapped in the cab after the accident, is quoted as saying moments after the crash that the train had taken the curve at 190 km/h (118mph) despite a speed limit on that section of 80km/h, unidentified investigation sources have told Spanish media.
If this is the case, it remains to be seen whether a systems failure or driver error was the cause, correspondents say.
Spanish press reactionThe website of Spanish daily ABC opens with the line "Spain, in mourning" above a video of the mangled train.
National daily El Pais has headlined a quote attributed to the train driver: "I'm going at 190!".
Regional daily La Voz de Galicia features a close-up of a crying woman being comforted as she awaits news in front of a hospital where the injured have been taken.
Radio station SER is starting its hourly bulletins with a clip from the head of the regional government Alberto Nunez Feijoo saying that "On its national day, the people of Galicia are crying".
State broadcaster Radio Nacional de Espana is running rolling coverage of the derailment and the first stages of the investigation into its causes.
News and opinion website La Republica comments: "This horrible event that has entirely shaken Spain adds to all the personal and collective problems of the country's economic and social crisis."
Mr Rajoy, who was born in Santiago de Compostela, expressed sadness and shock as he visited the scene.
"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," he said.
According to official figures, the crash is one of the worst rail disasters in Spanish history.
In 1972, a frontal train crash in Andalusia, in the south, left dozens of people dead. The figures given at the time ranged between 76 and 86.
In 1944, hundreds of people were believed to have been killed in a crash in Torre del Bierzo, in Leon province - though the official account in days of heavy censorship during the early rule of Gen Francisco Franco gave the figure as 78 killed.
'I saw corpses'
Santiago de Compostela
- One of the most important Christian pilgrimage sites in Europe
- El Camino de Santiago (The Way of St James) pilgrimage route has been followed by Christians since the Middle Ages
- The remains of St James, one of Jesus' 12 disciples and the patron saint of Galicia, are said to rest in the city
It was on the express route between the capital, Madrid, and the port city of Ferrol on the Galician coast, with 218 passengers on board - in addition to an unknown number of staff and crew.
Firefighter Jaime Tizon, one of the first to reach the site of the crash, described the scene as "hell".
"I'm coming from hell, I couldn't tell you if the engine was on fire, or one of the carriages or what..." he told Spanish newspaper ABC after dragging the injured and bodies from the train.
One witness, Ricardo Montesco, described how the train carriages "piled on top of one another" after the train hit the curve.
"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 wagon and there was fire. I saw corpses," he told Spanish Cadena Ser radio station.
The derailment happened on the eve of Santiago de Compostela's main annual festival where thousands of Christian pilgrims were expected to flock to the city in honour of St James.
The city's tourism board said all festivities planned for Thursday have been cancelled.