British Transport Police received a report of a man suffering a medical episode on board a train at Edinburgh Park station at 8.22pm on Saturday, May 21.
Paramedics attended and the man was taken to hospital for treatment.
ScotRail warned customers of the disruption on Twitter, at 8.48pm on Saturday, May 21.
The post read: “Due to the emergency services dealing with an incident near the railway earlier today between Edinburgh Park and Haymarket disruption is expected.”
Two hours later, at 10.45pm, the rail operator informed customers that the disruption had ended.