Military barracks, prison, royal residence, murder scene, birthplace of kings and queens… Edinburgh Castle has served a variety of purposes during the centuries that it's stood high above the city. While its lofty position was employed to military advantage in years gone by, it's now extremely useful as a navigational guide if you get lost in the surrounding warren of streets and closes. For most visitors, however, it's the city's main tourist attraction.
Built on centuries of older structures, the castle now comprises of a collection of buildings housed within the protective enclave of the battery walls (the other sides are protected by the sheer drop of the basalt cliffs). Many of the buildings were constructed and altered over several centuries, which can prove confusing for visitors. Although the Great Hall was originally built in 1511 under the instruction of James IV, for instance, almost everything there today dates from an extensive restoration that began in 1886. The main exception is the incredibly ornate hammerbeam roof, one of the foremost architectural treasures within the castle.
The oldest extant building is St Margaret's Chapel. Dating from the 12th-century reign of David I, it fell out of use in the 16th century and was employed as a gunpowder store for years. Its intended use was rediscovered in 1845, and it was restored to a serene simplicity. David's Tower - or, rather, the ruins of it - is another remnant of early royal constructions, although most of what can be seen in the dank vaults dates from rebuilding after the Lang Siege. The Royal Palace in Crown Square (originally the Palace Yard) requires far less imagination to visualise its regal history. The redoubtable Mary of Guise, mother to Mary, Queen of Scots, died here in 1560, while Mary herself gave birth to James VI in the birthing chamber, a small, panelled room. The last sovereign to sleep within this royal residence was Charles I in 1633.
The Honours of Scotland Exhibition is housed in the Royal Palace, in the first floor's Crown Room. Alongside the Crown, commissioned in 1540 by James V from local goldsmith John Mossman, the Sceptre, presented to James IV by Pope Alexander VI around 1494, and the Sword of State, presented to James IV by Pope Julius II in 1507, you can see the Stone of Destiny (aka the Stone of Scone), on which Scottish kings were crowned for centuries. Or, at least, you can see what staff believe to be the Stone of Destiny. In 1950, four Scots students swiped it from Westminster Abbey,which had been its home since Edward I removed it from Scone Abbey in 1296. Three months later, a similar stone turned up outside Arbroath Abbey, and was taken back to London. It was eventually returned to Scotland in 1996, but opinion is split as to its legitimacy.
The castle is steeped in military history, but it's also still a British Army barracks: it's currently the home headquarters of the Royal Regiment of Scotland and serves as a locus for some of the work of 52 Infantry Brigade. The castle also hosts the National War Museum of Scotland, which charts four centuries of Scottish involvement in wars in a humbling and largely objective way.
A more sombre military note is sounded by the imposing Scottish National War Memorial on Crown Square. Designed in 1924 by Sir Robert Lorimer and opened in 1927 by the Prince of Wales (later Edward VIII), it's a shrine to Scotland's war dead. (If you're at the castle solely to visit the memorial, you don't need to pay the entrance fee.) Below Crown Square are the castle vaults, where you'll find an effective reconstruction of the conditions endured by prisoners of war from successive skirmishes with France in the 18th and 19th centuries, and even the American War of Independence.
The buildings are the main attractions at the castle, but it's worth keeping your eyes peeled for more ephemeral bits and pieces: the Dog Cemetery on the Upper Ward; the graffiti scrawled by Napoleonic and American POWs (and their banknote forgery equipment); the 'Laird's Lug' spying device in the Great Hall; and Mons Meg, the huge six-ton cannon next to St Margaret's Chapel. Representing the height of technological advancement in her time, she was presented to James II in 1457 and last fired in 1681, when her barrel burst. While you're enjoying the views or scaring yourself with a peep over the drops, spare a thought for Sir Thomas Randolph and his men, who scaled the northern precipice in 1314 in order to wrest the castle from the English.
The most illuminating way of exploring the castle is with one of the audio guides (available in six languages; £3.50, £1.50-£2.50 discounts). The gift shop's offerings cover all bases, from tartan tat and pocket-money treats to toys, shirts and full-size replica weaponry. Disabled visitors should note that a wheelchair-accessible courtesy vehicle runs from the Esplanade to the upper reaches of the castle.