Edinburgh Castle is a historic fortress which dominates the skyline of the city of Edinburgh, Scotland, from its position on the Castle Rock. Archaeologists have established human occupation of the rock since at least the Iron Age (2nd century AD). There has been a royal castle on the rock since at least the reign of David I in the 12th century, and the site continued to be a royal residence until 1633. From the 15th century the castle's residential role declined, and by the 17th century it was principally used as military barracks with a large garrison.
As one of the most important strongholds in the Kingdom of Scotland, Edinburgh Castle was involved in many historical conflicts from the Wars of Scottish Independence in the 14th century to the Jacobite rising of 1745. Research undertaken in 2014 identified 26 sieges in its 1100-year-old history, giving it a claim to having been "the most besieged place in Great Britain and one of the most attacked in the world".
The castle also houses the Scottish regalia, known as the Honours of Scotland and is the site of the Scottish National War Memorial and the National War Museum of Scotland.
The castle is Scotland's most-visited paid tourist attraction, with over 2 million visitors in 2017 and over 70 percent of leisure visitors to Edinburgh visiting the castle. As the backdrop to the Edinburgh Military Tattoo during the annual Edinburgh Festival the castle has become a recognisable symbol of Edinburgh and of Scotland.