Speed restrictions could be brought in for trains running in Scotland as the network copes with one of the hottest May bank holidays on record.
Network Rail has issued a warning that rail commuters may face delays due to the forecast heat.
Temperatures of up to 26C have been forecast for the west coast of Scotland.
Engineers will carry out extra track inspections this weekend as part of “special preparations” prompted by the weather forecast.
Special monitoring equipment will be used to help spot rails that are becoming too hot.
A statement issued by Network Rail said: “Special preparations are being made to help keep Scotland’s railway on the move.
“During heatwaves, rails in direct sunshine can be as much as 20C hotter than air temperature and expand as they get hotter – sometimes causing them to curve or buckle.”
The statement added: “If rail temperatures in an area do rise significantly, some localised speed restrictions may be put in place to slow trains down and reduce the amount of force being placed on the rails.
“Engineers have also been preparing in advance – stressing sections of track (artificially stretching the rails) in known hot-spot areas and also painting rails white to help reflect the sun and keep them up to 10C cooler.”
David Dickson, ScotRail Alliance infrastructure director, said: “On very sunny days, rails in direct sunshine can be as much as 20C above air temperature.
“As rails are made out of steel, they expand as they heat up and can buckle, causing disruption to travel.
“If a section of track is judged to be at risk, we introduce speed restrictions. Slower trains exert lower forces on the track and reduce the chance of it buckling.
“Our engineers will be out throughout the weekend, monitoring rail temperatures and working hard to make sure we effectively manage any potential issues and keep customers on the move.”