Commuters faced disruption to train services in Fife on Wednesday after the railway line near Burntisland was closed due to a potentially “unsafe” wall.
Services were unable to run through the area for about half an hour while an inspection was carried out by workers.
Posting on Twitter, Network Rail Scotland said: “We’re attending a suspected unsafe retaining wall in the Burntisland area which needs an inspection by an engineer before we can allow train services through the area.”
It posted an update just after 5.30pm to say the area had been deemed safe and the lines were reopening.
ScotRail said services were being delayed or diverted via Cowdenbeath while the inspection took place.