Spanish authorities initially reported 10 deaths, but state-owned news agency EFE and other media reported later that the death toll had risen to at least 30.
It was the second major train accident in Spain in 2026.
Spain's rail system operator ADIF said the crash occurred on Wednesday morning in the province of Toledo.
Rail service was suspended between Madrid, Ciudad Real and Andalusia.
Esther Padilla, spokeswoman for the Castilla La Mancha region, told state broadcaster TVE that the accident was between two high-speed trains carrying hundreds of passengers and heading in the same direction from the capital Madrid to Seville in southwestern Spain.
One ran into the tail of the other that had stopped, knocking two of its cars off the track.
She said the cause of the crash was not known.
The crash, which occurred in a flat stretch surrounded by fields in between the towns of Urda and Los Yébenes, left one car shredded into bits of metal and other material, scattering debris down a gravel slope.
Spanish Health Minister Monica Garcia told TVE that emergency workers were focusing on rescuing survivors and bodies from the two most damaged train cars.
She said the injured were being sent to hospitals in the area.
The accident involved a train from Spain's state-owned RENFE company and the private rail company IRYO.
It appeared the RENFE train rammed the IRYO train, Spanish media reported.
Trains from those two companies were also involved in a deadly crash in January.
Padilla said that 397 passengers were in the RENFE train and 147 passengers in the IRYO train.
IRYO, an Italian-owned company, said it had "activated its security protocols and is closely working with authorities".
The mayor of the nearby town of Urda, Manuel Galan, told Spanish state broadcaster TVE that civil protection authorities had asked his town hall to prepare a sports pavilion to attend to injured passengers.
A military emergency brigade was deployed to help emergency services, firefighters and police.
Spanish Prime Minister Pedro Sanchez cancelled his agenda to focus on the crash, writing on X that he was "dismayed by the serious train accident in Toledo".
"Emergency services are working on site to attend to the affected passengers," wrote Sanchez, who faces a national election in November.
Spain's King Felipe VI and Queen Letizia said in a short statement on X that they were following news of the accident.
"We share in the grief of the families and loved ones of those who lost their lives, and we send our heartfelt support to the injured and all those affected," the royal couple said.
The regional president of Castilla La Mancha, Emiliano García-Page, wrote on X that he was on his way to the crash site.
In January, 45 people died in southern Spain when a train jumped the track and hit an oncoming train.
The crash was the deadliest in Spain since a 2013 crash that killed 80 people.