Train services through Fife were thrown into chaos due to a lorry hitting a bridge near Collessie.
The line was closed at Ladybank on Friday morning as inspectors assessed the damage to the structure, which has a 15ft height restriction.
Services between Edinburgh and Perth cancelled and shuttle buses operated between Kirkcaldy and Perth.
A warning was also issued by ScotRail that services between Edinburgh and Aberdeen could also be affected.
However, the train operator confirmed around midday that the route had reopened and services were returning to normal.
It tweeted: “Our staff have finished examining the damage to the bridge and we can now run services safely over the effected area.
“We’re now working hard to get services back on schedule.”
A Network Rail spokesman had earlier said examiners were out looking at the structure to assess the damage.
He said: “It was hit by an HGV and we need to make sure it is safe.”
NEW: Due to a lorry colliding with a bridge at #Ladybank, services running through this station will be cancelled, delayed or revised. Sorry ^AE pic.twitter.com/MavcfuaKif
— ScotRail (@ScotRail) July 6, 2018
The driver of the Howdens lorry escaped injury in the incident, which occurred around 7.30am and blocked a lane of the A91.
A Police Scotland spokeswoman said: “We were called at 7:28am to the A91 at Collessie following reports that a truck had collided with a railway bridge.
“Thankfully the driver was uninjured.
“One lane was however blocked as a result.”