One of the best-preserved medieval castles in Scotland, Craigmillar Castle was begun in the late 14th century by the Preston family, after King Robert II granted the lands of Craigmillar to Sir Simon Preston, Sheriff of Midlothian, in 1374.
The L-plan tower house at the centre is the original structure, and was built on a rocky outcrop. Around this was built a courtyard wall in the early 15th century, followed by an outer courtyard wall in the early to mid 16th century.
The castle was bought from the Prestons by the Lord of the Exchequer Sir John Gilmour in 1660, at the same time as the neighbouring estate of The Inch. By now the castle was considered old-fashioned, so Sir John rebuilt the West Range to provide accommodation more suitable for a man of his standing.
By the early 18th century the Gilmour family had moved to The Inch, and in 1761 the castle was advertised as “to let”. By 1775 it was in ruins.
In 1946 the castle passed into state care.