The first castle was built in either the late 14th or in early 15th century,[1] perhaps begun by Henry Sinclair, Earl of Orkney, Baron of Roslin (c. 1345–1400).
The courtyard was entered via a drawbridge over an artificial ditch, giving access to a pend in the small north range.
[2] The castle contained a scriptorium during the 15th century, and five St Clair manuscripts, dating back to 1488, are in the National Library of Scotland.
[3] Roslin was more severely damaged by the Earl of Hertford, who burned the castle during the War of the Rough Wooing in 1544.
A new five-storey east range was built into the side of the rock, and the gatehouse was rebuilt, this time with a permanent stone bridge.
The rebel Earl of Bothwell stayed, but left in a hurry leaving behind his coffers with clothes and silver plate.
[6] The upper part of the east range was renovated in 1622, with renaissance details and carving to door and window surrounds.
It is entered through a richly carved doorway, dated 1622 and initialled SWS for Sir William Sinclair, which gives access to the third floor.
[2] All five floors are connected by a central scale-and-platt staircase, added in the early 17th century to replace a turnpike stair in the south-west.
The main hall, in the south part of the block, has been divided, but retains a large fireplace with the carved initials WS and JE, for William Sinclair and his wife Jean Edmonstone, and the date 1597.
[15] The castle was also used as a location for Ron Howard's film adaptation of Dan Brown's book, The Da Vinci Code.