Situated at the centre of Dunfermline in W Fife, Dunfermline Abbey stands on a ridge that falls steeply on the south and west to the course of the Tower Burn which flows through Pittencrieff Park.
The original Benedictine priory was founded in the 1070s by Queen Margaret on the site of an earlier chapel of the Celtic Church and in 1128 her son David I extended the building and increased its status by making it an abbey. The western part of the present building is the nave of the Abbey church built by David I between 1128 and 1150. The eastern end, with the tower bearing the words 'King Robert the Bruce', is the new parish kirk that was built on part of the ruins of the old abbey in 1818-21.
In medieval times the abbey became a major ecclesiastical centre and was the burial place of several Scottish monarchs including Malcolm Canmore, his wife Queen Margaret and Robert the Bruce whose tomb was rediscovered in 1818. Queen Margaret was canonized in 1250 and a chapel and shrine were built at the east end and centre of the abbey. Subsequently in 1303, the abbey was destroyed by Edward I of England who recognised the significance of the site as a focal point of Scottish nationalism. Partially rebuilt, it was further damaged during the Reformation in the 16th century.
The adjacent royal palace of Dunfermline grew out of the guest house of the abbey after its closure during the Reformation and was given as a wedding present to Anne of Denmark by her husband James VI in 1589. Prior to the Union of the Crowns in 1603 Anne of Denmark stayed here from time to time, and in 1600 her son, later to become Charles I, was born here.