This impressive fortress perched high on its rock promontory was visited by Mary, Queen of Scots on the night of 26th August 1562 during her first progress to the north of Scotland. On her way back, she stayed there again between 5th and 7th November. She also returned in September 1564. Some parts of the castle date back to the 12th century, but in Mary's times, only the main L-plan keep and chapel would have been there, the later ranges having been added in the late 16th and 17th centuries. Dunnottar's troubled past includes its siege by William Wallace in 1296, the rescue of the Crown jewels, and the imprisonment and torture of over 150 Covenanters in the 17th century. The castle was the home of the Keith Earl Marischals, who acquired the property in 1382. The castle was partly dismantled in the 18th century, and was used during the shooting of "Hamlet" starring Mel Gibson.