The station was opened by the
Dunfermline and Queensferry Railway on 1 November 1877, named Dunfermline, Comely Park. It was rebuilt in 1889, the Down (northbound) platform being extended eastwards with a new booking office building and a new Up (southbound platform) being provided; the extended facilities were brought into use on 5 March 1890, from which date the station was known as
Dunfermline Lower in contradistinction to
Dunfermline Upper on the line to Stirling. After the latter station was closed in 1968, the suffix was dropped and it became known as plain
Dunfermline. During the 1970s and 1980s
British Rail only ran a regular daytime service on the Dunfermline line between Edinburgh and as far as Cowdenbeath; Lochgelly & Cardenden were only served during the weekday business peaks, whilst the remainder of the route to
Thornton Junction was freight-only (having been closed to passengers in 1969). In 1989 though, BR decided to restore the Fife circular. In March 1998, Dalgety Bay opened, while two years later in 2000, a new station was opened in the expanding eastern suburbs of Dunfermline and given the name of
Dunfermline Queen Margaret, after the nearby
Queen Margaret Hospital. To prevent confusion following the opening of the nearby
Dunfermline Queen Margaret in 2000, the station was again renamed to
Dunfermline Town. Around the same time the frequency was improved to every 30mins to Edinburgh. Following Dunfermline being granted city status,
Jenny Gilruth, the Transport Minister, announced on 3 October 2022 that the station would be renamed to Dunfermline City. == Station facilities ==