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 platform being extended eastwards with a new booking office building and a new Up 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 Upperon 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. 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.
Station facilities
The station can be accessed from St. Margaret's Drive. The station building is on the northbound platform. In the building is a ticket office, a toilet and a kiosk. There is also a CCTV monitoring centre for stations in the east of Scotland and a taxi ordering office. There is a public phone at the entrance and there are waiting rooms on both platforms. The platforms are connected by a ramped subway, this providing an alternative access to the station from Woodmill Street on the south side. There is a taxi rank at the main entrance and station car parks on both sides of the railway. CCTV is in operation.
Train services
On Mondays to Saturdays during the daytime, there is generally a half-hourly service southbound to, and a half-hourly service northbound round the Fife Circle as far as, with one service continuing through, eventually coming back to. In the evenings the service is hourly There is also a daily service to and from Perth via Markinch. In 2016 the Sunday frequency service was increased to hourly, from its previous 2 hourly service.