Dunfermline (Scottish Gaelic: Dùn Phàrlain) is a town in Fife which had city status until 1970. It is located on high ground three miles from the northern shore of the Firth of Forth on the route of major road and rail crossings across the firth to Edinburgh and the south.
Dunfermline was an ancient capital of Scotland and is the burial place for many in the country's line of monarchs including Robert I and Saint Margaret. The poet Robert Henryson, one of the country's major literary figures, also lived in Dunfermline and was associated with its abbey. Ruins of the former monastic buildings around the abbey (now a parish church) include the remains of the royal palace and are an important tourist attraction.
The earliest record of Dunfermline was as a centre for the Culdee faith in the early 9th century, but its first documented history begins in the mid-11th century with King Malcolm III who shifted the royal seat of power in Scotland from Forteviot in Perthshire to Dunfermline.
In 1069, Malcolm III took the Saxon princess, Margaret as his second wife, and his new Queen's faith, with its roots in the Catholicism of her native Hungary, was instrumental in bringing about profound religious and cultural changes in the newly established royal centre. Queen Margaret encouraged Malcolm III to convert the small Culdee church into a Benedictine priory. This was to prove a major factor in the romanisation of the church in Scotland.
In modern times, the most famous son of Dunfermline was the wealthy industrialist, businessman, and philanthropist Andrew Carnegie. He was the central figure in promoting early twentieth century urban renewal for the city (as was) and his financial legacy is still of major importance.