Rail services to Dundee and Perth were cancelled on Thursday evening after a person was struck by a train.
The incident happened between Inverkeithing and Edinburgh. It is believed to have taken place between 4pm and 5pm.
ScotRail said it was liaising with the emergency services.
Services across Fife, Dundee, Perth, Aberdeen and Inverness were cancelled, with replacement buses brought in.
Though trains are back up and running, ScotRail said customers should expect disruption until 8pm as a result of trains and crew being “out of position”.
Earlier this evening ScotRail said: “Sadly due to a person being hit by a train between Inverkeithing and Edinburgh services between Edinburgh and Cowdenbeath/Dundee/Glenrothes/Inverness/Inverurie/Perth will be cancelled, delayed or revised.”
At 6.20pm the firm updated customers, saying: “Inverkeithing – The line has now reopened and we’re starting to operate services through Fife. Trains and crew remain out of position so disruption is expected to continue until 8pm.”
NEW: Sadly due to a person being hit by a train between #Inverkeithing & Edinburgh services between Edinburgh & Cowdenbeath/Dundee/Glenrothes/Inverness/Inverurie/Perth will be cancelled, delayed or revised. pic.twitter.com/7f3dJKKFbm
— ScotRail (@ScotRail) December 21, 2017
UPDATE: #Inverkeithing – The line has now reopened and we're starting to operate services through Fife. Trains & crew remain out of position so disruption is expected to continue until 20:00.
— ScotRail (@ScotRail) December 21, 2017