The Orygynale Cronykil of Andrew of Wyntoun (c. 1350 – c. 1423), an early source for Scottish history, names "Ebrawce" (Ebraucus), a legendary King of the Britons, as having "byggyd [built] Edynburgh".
Excavations at nearby Dunsapie Hill, Duddingston, Inveresk and Traprain Law had revealed relatively large settlements and it was supposed that these sites had been chosen in preference to the Castle Rock.
[31] The poem tells of the Gododdin King Mynyddog Mwynfawr,[32] and his band of warriors, who, after a year of feasting in their fortress, set out to do battle with the Angles at "Catreath" (possibly Catterick) in Yorkshire.
[39] Malcolm's youngest son, King David I (r.1124–1153), developed Edinburgh as a seat of royal power principally through his administrative reforms (termed by some modern scholars the Davidian Revolution).
John Barbour's narrative poem The Brus relates how a party of thirty hand-picked men was guided by one William Francis, a member of the garrison who knew of a route along the north face of the Castle Rock and a place where the wall might be scaled.
[44][56] In the early 15th century, another English invasion, this time under Henry IV, reached Edinburgh Castle and began a siege, but eventually withdrew due to lack of supplies.
In 1464, access to the castle was improved when the current approach road up the north-east side of the rock was created to allow easier movement of the royal artillery train in and out of the area now known as the Upper Ward.
[61] By 1511 Edinburgh was the principal foundry in Scotland, supplanting Stirling Castle, with Scottish and European smiths working under Borthwick, who by 1512 was appointed "master melter of the king's guns".
Around the end of the fifteenth century, King James IV (r.1488–1513) built the Palace of Holyroodhouse, by the abbey, as his principal Edinburgh residence and the castle's role as a royal home subsequently declined.
Robert Borthwick and a Frenchman, Antoine d'Arces, were involved in designing new artillery defences and fortifications in 1514, though it appears from lack of evidence that little of the planned work was carried out.
[58] The following year, the Catholic Mary, Queen of Scots, returned from France to begin her reign, which was marred by crises and quarrels among the powerful Protestant Scottish nobility.
In 1565, the Queen made an unpopular marriage with Henry Stuart, Lord Darnley, and the following year, in a small room of the Palace at Edinburgh Castle, she gave birth to their son James, who would later be King of both Scotland and England.
The King's party appealed to Elizabeth I of England for assistance, as they lacked the artillery and money required to reduce the castle, and feared that Grange would receive aid from France and the Duke of Alba in the Spanish Netherlands.
To make this possible, since Nova Scotia was so distant, the King declared that sasine could be taken either in the new province or alternatively "at the castle of Edinburgh as the most eminent and principal place of Scotland.
On 8 September, just two days after the rising began, a party of around 100 Jacobite Highlanders, led by Lord Drummond, attempted to scale the walls with the assistance of members of the garrison.
The Jacobite army, under Charles Edward Stuart ("Bonnie Prince Charlie"), captured Edinburgh without a fight in September 1745, but the castle remained in the hands of its ageing Deputy Governor, General George Preston, who refused to surrender.
[108] Works in the 1880s, funded by the Edinburgh publisher William Nelson and carried out by Hippolyte Blanc, saw the Argyle Tower built over the Portcullis Gate and the Great Hall restored after years of use as a barracks.
[56] Following the death of Prince Albert in 1861, the architect David Bryce put forward a proposal for a 50-metre (160 ft) keep as a memorial, but Queen Victoria objected and the scheme was not pursued.
[113] The position of Governor of Edinburgh Castle, vacant since 1876, was revived in 1935 as an honorary title for the General Officer Commanding in Scotland, the first holder being Lieutenant-General Sir Archibald Cameron of Lochiel.
[121] Statues of Robert the Bruce by Thomas Clapperton and William Wallace by Alexander Carrick were added in 1929, and the Latin motto Nemo me impune lacessit is inscribed above the gate.
The royal Treasurer's Accounts of the time record a payment to soldiers for retrieving one of her stones from Wardie Muir near the Firth of Forth, fully 2 miles (3 km) from the castle.
[143] The gun has been defunct since its barrel burst while firing a salute to greet the Duke of Albany, the future King James VII and II, on his arrival in Edinburgh on 30 October 1681.
[144] The Half Moon Battery, which remains a prominent feature on the east side of the castle, was built as part of the reconstruction works supervised by the Regent Morton, and was erected between 1573 and 1588.
[146] The square is formed by the Royal Palace to the east, the Great Hall to the south, the Queen Anne Building to the west, and the National War Memorial to the north.
[153] The decorative carved stone corbels supporting the roof have Renaissance detailing, which has been compared to works at Blois, France, of around 1515, indicating that the arts in Scotland were relatively advanced at this time.
[156] The Queen Anne Building provided accommodation for Staff Officers, but after the departure of the Army it was remodelled in the 1920s as the Naval and Military Museum, to complement the newly opened Scottish National War Memorial.
Upon the altar within the Shrine, placed upon the highest point of the Castle Rock, is a sealed casket containing Rolls of Honour which list over 147,000 names of those soldiers killed in the First World War.
The castle is run and administered, for the most part, by Historic Environment Scotland, an executive agency of the Scottish Government, although the Army remains responsible for some areas, including the New Barracks block and the military museums.
[1] Historic Environment Scotland undertakes the dual tasks of operating the castle as a commercially viable tourist attraction, while simultaneously bearing responsibility for conservation of the site.
The climax of the evening is the lone piper on the castle battlements, playing a pibroch in memory of dead comrades-in-arms, followed by massed bands joining in a medley of traditional Scottish tunes.