A burgh town in W Fife, Dunfermline is situated 4 miles (6 km) northwest of the Forth Bridge.
Now the second-largest town in Fife, Dunfermline has a history extending back over 1000 years to the foundation of a chapel by priests of the Celtic Church. It became an important Scottish centre when Malcolm Canmore moved his court here from Forteviot and built a fortress c.1065. Canmore's second wife, Queen Margaret, established the town as an ecclesiastical centre, founding a Benedictine priory that was elevated to the status of an Abbey in 1128. In 1250 Queen Margaret was canonised and her tomb in the abbey became a shrine.
The importance of Dunfermline declined after the Reformation in the 16th Century although James VI gave it a royal charter in 1588 prior to presenting the abbey to his wife as a wedding present. The town's economic fortune was revived during the 18th and 19th centuries with the development of the textile industry producing linen, cotton, woollen and damask goods. From 1975 to 1996 it was the administrative centre of Dunfermline District.
Today Dunfermline forms the heart of the so-called 'Bridgehead Dunfermline' economic development area and has industries that include printing, financial services and the manufacture of soft drinks, textiles, clothing, electronics, oil drilling equipment and call centres. Some of these industries are now located in the Elgin Street and Albany Industrial Estates and in the larger Pitreavie Business Park to the south of the burgh.
The town, which is the home of the Carnegie Dunfermline Trust (1903), has many public parks, playing fields and community centres in addition to the Carnegie Centre swimming baths, the football park of Dunfermline Football Club and three 18-hole golf courses (Canmore, Pitreavie and Pitfirrane). Queen Margaret and Lynebank hospitals lie to the east and retail parks have been developed near the town centre and at Halbeath to the east.