Edinburgh Castle lies on the western edge of The Royal Mile in Edinburgh, Scotland.Castle Rock, upon which the castle sits, has housed human settlements since at least 900 B.C., but it wasn’t until 1093 that the historical record locates a castle on the hill.It was then, for unknown reasons, referred to as the Castle of Maidens.By 1142, and the reign of David I, the castle was to become a royal fortress. Although still mainly built of timber at the time, with the exception of the still extant St. Margaret’s Chapel, which was built of stone, the next century would see much of the building’s existing wooden structure converted to stone, to strengthen the castle’s defenses.The castle was captured by Edward I in 1296, and held by the British for the next 18 years, until Robert the Bruce’s army recaptured it in 1314.Once again it fell to the British in 1335, only to be freed by Sir William Douglas in 1341.The castle would reach its peak of prominence beginning with the reign of James III who made the castle his royal residence and began a rebuilding project which would last into the reign of James IV.By 1560 the castle lost favor with the royal family in favor of nearby Holyrood Palace.The castle, now used more for security reasons, was the home to Mary Queen of Scots in 1566, when she gave birth to her son, the future James VI of Scotland and James I of England.After Mary’s nobles rebelled at her 1567 marriage to the Earl of Bothwell, she was forced to abdicate the throne in favor of her young son.In later years the castle was used as a garrison fortress and much of the building that remains dates to this time.