<P> In 1511 Craigmillar was erected into a barony, and the outer courtyard was built around this time, possibly by another Simon Preston (d. 1520), Member of Parliament for Edinburgh in 1487, who had succeeded in 1478 . In September 1517, during an outbreak of plague in Edinburgh, the infant James V of Scotland moved to safety at Craigmillar . His French guardian De la Bastie had new locks made for his chamber and the two iron gates, and a stable was built for the king's mule . The family chapel within the outer court was first recorded in 1523 . In 1544, during the so - called Rough Wooing of Henry VIII of England, the English attempted to impose, by military force, a marriage alliance between Edward, Prince of Wales, and the young Mary, Queen of Scots . Craigmillar Castle was burned by English troops under the Earl of Hertford . The baron, Sir Simon Preston (d. 1569) had the castle repaired, with domestic ranges in the courtyard being remodelled . Sir Simon served as Lord Provost of Edinburgh for several years, and was a loyal supporter of Queen Mary, who appointed him to her Privy Council . </P> <P> Queen Mary stayed at Craigmillar twice, in September 1563 and from 20 November to 7 December 1566 . She is traditionally said to have slept in the small former kitchen within the tower house, although it is more likely that she occupied larger accommodation in the relatively new east range . On her second stay, Mary was still in poor health following a serious illness in October . Several of her noblemen were with her, and suggested to her that her unpopular husband, Henry Stuart, Lord Darnley, could be removed, either by divorce or by other means . An agreement, the "Craigmillar Bond", was signed by Mary's Secretary of State William Maitland of Lethington, and several nobles including the earls of Bothwell, Argyll and Huntly . The bond does not survive, but set out the conspirator's intent to remove Darnley . Although Mary made it clear that she was unhappy with Darnley, she was not part of the conspiracy, and was probably unaware of the plot to kill her husband . It was initially intended that Darnley would lodge at Craigmillar when he returned to Edinburgh, although he opted to stay at Kirk o' Field in the town, where he was murdered on 10 February 1567 . In 1572, after Queen Mary's flight into England, the Regent Mar used Craigmillar as a base during his siege of Edinburgh Castle, which was being held by supporters of the exiled Queen . King James VI later visited Craigmillar himself, in 1589, when he was the guest of Sir David Preston . </P> <P> On the death of Sir Robert Preston in 1639, Craigmillar passed to a distant cousin, David Preston of Whitehill . His son sold the castle out of the family, and it was bought by Sir John Gilmour (d. 1671) in 1660, who purchased the neighbouring estate of The Inch at the same time . A Royalist, Gilmour was rewarded following the Restoration of King Charles II, becoming Lord President of the Court of Session in 1661 . He remodelled the west range to provide more modern accommodation in the 1660s, but in the early 18th century, the Gilmours left the castle for Inch House, just west of Craigmillar . It was claimed that two of the laird's daughters continued to live in Craigmillar Castle after the rest of the family had left . Afterwards, Craigmillar Castle formed a romantic feature in the park of the Inch estate . It was ruined by 1775, when the antiquarian and poet John Pinkerton wrote Craigmillar Castle: an Elegy . The castle became a popular tourist attraction from the late 18th century, and was drawn by numerous artists . A proposal to renovate the building for the use of Queen Victoria was put forward in 1842, but came to nothing . Victoria herself visited the castle in 1886, and much restoration work was undertaken by its then owner, Walter James Little Gilmour (d. 1887). </P> <P> Craigmillar Castle has been in state care since 1946, and is now maintained by Historic Environment Scotland . The castle is a category A listed building, the highest level of protection for a historic building in Scotland, and is also a Scheduled Ancient Monument . The grounds of the castle are included on the Inventory of Gardens and Designed Landscapes, the national register of historic gardens . </P>

The castle that sits on top of the volcanic mound