    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), although the nature of the early settlement is unclear. 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 the union of the crowns in 1603. 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. its importance as a part of scotland's national heritage was recognised increasingly from the early 19th century onwards, and various restoration programmes have been carried out over the past century and a half. 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. it has been besieged, both successfully and unsuccessfully, on several occasions. few of the present buildings pre-date the lang siege of the 16th century, when the medieval defences were largely destroyed by artillery bombardment. the most notable exceptions are st margaret's chapel from the early 12th century, which is regarded as the oldest bui
Castles_in_City_of_Edinburgh Category_A_listed_buildings_in_Edinburgh Defunct_prisons_in_Edinburgh Edinburgh_Castle Historic_Scotland_properties Historic_house_museums_in_Edinburgh Listed_castles_in_Scotland Listed_prison_buildings_in_Scotland Museums_in_Edinburgh Prison_museums_in_the_United_Kingdom Regimental_museums_in_Scotland Renaissance_architecture_in_Scotland Reportedly_haunted_locations_in_Edinburgh Royal_Regiment_of_Scotland Scheduled_Ancient_Monuments_in_Scotland Scottish_parliamentary_locations_and_buildings