A person died on Wednesday after being hit by a train on the railway line near Dunfermline.
Services between Edinburgh and Glenrothes were disrupted after the incident on Wednesday afternoon, with the line reopening later the same day.
ScotRail said the line had been closed while emergency services dealt with the incident, with it reopening at around 4pm.
All services between Edinburgh and Glenrothes With Thornton, via Dunfermline, were disrupted, with ScotRail warning it could take some time for timetables to return to normal.
An update said: “The line has now reopened and our services can resume.
“However, they will still be subject to delay, cancellation or revision as we focus on getting trains and crew back into position.”
NEW: Sadly, a person has been hit by a train between Inverkeithing and Cowdenbeath the line is closed.
While the emergency services attend our services between Edinburgh and Glenrothes With Thornton via Dunfermline Town will be cancelled. ^Megan pic.twitter.com/7LT2LpSDkQ
— ScotRail (@ScotRail) November 3, 2021
A spokesperson for British Transport Police said:Â “British Transport Police were called to the line near Dunfermline at 2.07pm today following reports of a casualty on the tracks.
“Paramedics also attended, however sadly a person was pronounced dead at the scene.
“Officers are working to identify the deceased and inform their next of kin.
“This incident it not being treated as suspicious.”