From its position on the Castle Rock, Edinburgh Castle is a historic fortress that dominates the skyline of Edinburgh, Scotland’s capital. Since at least the Iron Age, archeologists have established human occupation of the rock although the nature of the early settlement is unclear. Since the reign of David I in the 12th century, there has been a royal castle on the rock and the site continued to be a royal residence until 1633 at times. The residential role of the castle declined from the fifteenth century, and by the seventeenth century it was primarily used as military barracks with a large garrison. Its importance as part of Scotland’s national heritage has been increasingly recognized since the early 19th century, and various restoration programs have been undertaken over the past one and a half centuries. As one of the Kingdom of Scotland’s most important strongholds, Edinburgh Castle was involved in many historical conflicts from the Wars of Scottish Independence in the 14th century to the Jacobite rising of 1745.