Dunfermline Palace is a former Scottish royal palace in Dunfermline, Fife. It is currently a ruin under the care of Historic Scotland and an important tourist attraction in Dunfermline.
Dunfermline was a favourite residence of many Scottish monarchs. Documented history of royal residence there begins in the 11th century with Malcolm III who made it his capital. His seat was the nearby Malcolm's Tower, a few hundred yards to the west of the later palace. In the medieval period David II and James I of Scotland were both born at Dunfermline.
Dunfermline Palace is attached to the historic Dunfermline Abbey, occupying a site between the abbey and deep gorge to the south. It is connected to the former monastic residential quarters of the abbey via a gatehouse above a pend (or yett), one of Dunfermline's medieval gates. The building therefore occupies what was originally the guest house of the abbey. However, its remains largely reflect the form in which the building was developed by James IV in a refabrication around 1500. Throughout the sixteenth century, Scotland's monarchs and royal family members were frequently in residence.
In 1589 the palace was given as a wedding present by the king, James VI, to Anne of Denmark after their marriage. She gave birth to three of their children there; Elizabeth (1596), Charles (1600) and Robert (1602).