At least 68 people were killed when two high-speed trains collided near the city of Toledo, about 70 kilometres south of Madrid, with rescuers searching the wreckage for more victims.
It was Spain's second fatal high-speed rail crash this year and Europe's deadliest train accident since 2013, the Reuters news agency reported.
Polish President Karol Nawrocki offered condolences to the families and loved ones of those killed.
"I was deeply saddened to learn of the tragic train crash in Spain, in which so many people lost their lives," Nawrocki said in a post on X.
"On behalf of the Polish people and on my own behalf, I offer my deepest condolences to the families and loved ones of the victims. I wish all those injured a speedy recovery," he added.
"Poland mourns alongside the Spanish people. Our thoughts are with those who have lost their loved ones and with everyone affected by this tragedy," Nawrocki also wrote.
Prime Minister Donald Tusk also sent condolences and expressed solidarity with Spain.
"I extend my deepest condolences to the families who have lost their loved ones and wish for a swift recovery of those injured," Tusk said, adding that "all Poles are with the Spanish people in this terrible time."
Foreign Minister Radosław Sikorski said he was "deeply saddened" by the tragic train accident in Spain.
"My heartfelt condolences go out to the families and loved ones of the victims," he wrote. "I wish all those injured a swift recovery. In these difficult moments, Poland stands in solidarity with Spain and its people. We stand with you."
Infrastructure Minister Dariusz Klimczak also offered condolences on X.
"Deepest condolences to the families and loved ones of the victims of the tragic rail accident in Spain. My thoughts are also with the injured and all those affected by this tragedy," Klimczak wrote.
Addressing his Spanish counterpart Oscar Puente, he added: "In these painful moments, please accept my expressions of solidarity and support."
Puente told reporters in Madrid that the crash near Toledo occurred after a train was authorised to continue despite an active red signal because another train was stationary on the track ahead.
He said the red signal had been triggered by a computer communications failure that automatically stopped traffic, and that an erroneous decision had been made to restart the train in breach of protocol, Reuters reported.
Photo: EPA/CHEMA MOYA
The Polish foreign ministry said it had no information about any Polish casualties.
"We are checking media reports; our consulate in Spain is operating. For now there is no information about any injured Poles," ministry spokesman Maciej Wewiór told reporters.
Other European leaders, including French President Emmanuel Macron, also expressed their condolences.
European Commission chief Ursula von der Leyen said Europe was mourning with Spain.
The crash follows a January accident involving high-speed trains on the same line that killed 46 people.
In that crash, a train derailed and smashed into an oncoming train near Adamuz in southern Spain's Córdoba province, prompting debate over investment in railway maintenance, Reuters reported.
Wednesday's collision was Europe's deadliest train accident since 2013, when a high-speed train derailed near the northwestern Spanish city of Santiago de Compostela, killing 80 people, according to Reuters.
Spain is due to hold a parliamentary election on November 29.
(gs)
Source: IAR/PAP, TVP Info, Reuters