Dumferline was an ancient capital of Scotland. Dunfermline Palace, currently a ruin, was a royal residence of many Scottish monarchs, beginning in the 11th century with Malcolm III who made it his capital.
Dunfermline Palace is attached to the historic Dunfermline Abbey, occupying a site between the abbey and deep gorge to the south. The palace was given as a wedding present by the king, James VI, to Anne of Denmark after their marriage.