Passengers were stuck for hours in carriages with no air-conditioning on one of the hottest days of the year.
The train left from Madrid at 1.20pm, heading to Santander, but had to stop at about 3pm "in the middle of nowhere" in Dueñas about halfway through the trip after the electricity was cut during an attempted robbery, Spanish media reported.
Authorities said that the attempted cable robbery had sparked a fire, forcing train operators to cut voltage to the train's catenary system, which provides electrical power to the train. Due to the power outage, the more than 200 passengers were left without air conditioning.
Temperatures reached 40C (104 Fahrenheit), as passengers complained that they were given no information as to why the train was stuck or how long they could expect to be stranded.
"The Alicante-Santander train has been stopped in Dueñas for more than half an hour (and counting). They haven't told us anything and this train car is a pressure cooker," wrote passenger JC Cristóbal on Twitter.
Más de media hora parado en Dueñas (y sumando) el tren Alicante—Santander. No nos dicen nada y el vagón es una olla exprés #renfe— JC Cristóbal (@JCCHristo) June 29, 2015
Renfe train operators eventually distributed bottles of water and Coca-Cola to passengers and opened the doors after people "threatened to break the windows", according to newspaper El Pais.
It still took the Civil Guard a couple hours to come help the train and hand out more water. At least two people had to be taken off the train for medical treatment suffering from heat exhaustion.
Finally, at about 6.30pm, passengers were transferred to another train bound for Santander arriving at the Cantabrian capital at 11pm - more than five hours past the original arrival time.
Meanwhile, passengers on a plane from Madrid bound for Cancun, Mexico also had bad luck when they were stuck onboard for an hour and a half, without air conditioning, in what people inside said were temperatures of more than 50C (122 degrees Fahrenheit), news agency EFE reported on Monday.
The plane had experienced a breakdown that prevented it at first from taking off, and then the vehicle to bring the aircraft to an unloading bridge also malfunctioned.
Desperate passengers called the Civil Guard to come help and rescue the more than 500 inside.
The country is currently experiencing a heatwave across most of the Iberian Peninsula with temperatures reaching in excess of 40C.