The history of Edinburgh Castle is the history of Scotland itself. For more than 1,100 years a fortress has stood on this volcanic plug above the city, watching kings rise and fall, sieges come and go, and a small Iron Age hilltop become one of the most powerful symbols of Scottish identity. By one careful 2014 academic analysis, Edinburgh Castle has been besieged 26 times — making it the most attacked site in the British Isles and one of the most contested fortresses in the world.

This guide is a complete chronological timeline of Edinburgh Castle’s history, from its earliest Iron Age occupation to its modern role as both a working military headquarters and the most-visited paid attraction in Scotland. We’ve drawn on Historic Environment Scotland’s published research, archaeology from the National Museums of Scotland, primary chronicles from medieval Scottish abbey libraries, and modern military histories. Whether you’re visiting the castle, studying Scottish history, or simply curious, you’ll find every major event, royal personality, and architectural development covered below.

For practical visitor information see our companion guides on Edinburgh Castle tickets, prices and opening hours and what to see inside Edinburgh Castle. For broader context, our pillar guide to Edinburgh Castle ties this history to the modern visitor experience.

Edinburgh Castle on its historic rock stronghold under blue sky
Edinburgh Castle’s volcanic plug has been continuously fortified for at least 1,100 years.

Why Edinburgh Castle’s History Matters

Few places have shaped a nation as Edinburgh Castle has shaped Scotland. It was the seat of Scottish kings from the early medieval period through the Stuart dynasty. It witnessed the most significant sieges of the Wars of Scottish Independence. It held the crown jewels through the dark years of Cromwellian rule. It was the birthplace of the only monarch ever to unite the crowns of Scotland and England — and a working garrison from the medieval period to the present day.

Today Edinburgh Castle remains both a tourist site and an active military headquarters of the British Army. The Scottish National War Memorial inside the castle commemorates more than 200,000 Scottish service members who died in the World Wars and later conflicts. The castle’s history is therefore not just one of stone and battle but of national identity, religious schism, and the slow, often painful evolution of Scotland from independent kingdom to part of the United Kingdom.

The Volcanic Foundation: 350 Million Years Ago

Edinburgh Castle stands on a volcanic plug — the cooled core of a volcano that erupted in the Carboniferous period roughly 340 million years ago, in a tropical sea that covered what is now central Scotland. After the volcano died, glaciation in the last ice age scoured the softer surrounding rock westwards, leaving the famous “crag and tail” formation: a steep crag (Castle Rock) protected on three sides by sheer cliffs, with a long tail of softer ground stretching down to the east — what would become the Royal Mile.

This geology made Castle Rock the most defensively perfect location in central Scotland, accessible by foot only along the narrow ridge from the east. Every fortification on the rock for the next 3,000 years would exploit this single natural advantage.

Prehistory: 850 BC – 600 AD

Excavations on Castle Rock have produced material evidence of human occupation from around 850 BC, in the late Bronze Age. Pottery, midden deposits, and post-holes suggest a small settlement. By the Iron Age, around 600 BC, a recognisable hill fort had been built on the summit — one of several across the Lothian region.

The first written reference to a fortress on the rock comes from around 600 AD. The Welsh poem Y Gododdin, attributed to the bard Aneirin, describes warriors from the Brythonic kingdom of the Gododdin (whose capital, Din Eidyn, was almost certainly Castle Rock) feasting at Mynyddog the Wealthy’s stronghold before riding south to defeat at the battle of Catraeth around 600 AD. The poem is one of the earliest surviving pieces of literature in any British language.

The Anglo-Saxon kingdom of Northumbria captured Din Eidyn around 638 AD, anglicising the name to “Edin-burh” — “Edin’s fortress.” For the next several centuries the rock changed hands repeatedly between Northumbrian, Pictish, and emerging Scottish kingdoms.

The Foundation Years: David I and St Margaret’s Chapel (c. 1124-1153)

The earliest surviving structure on the castle rock is St Margaret’s Chapel, a tiny Romanesque chapel built around 1130 by King David I in memory of his mother, Saint Margaret of Wessex. Margaret had been queen of Scotland from her marriage to King Malcolm III in 1070; she died at Edinburgh Castle in 1093, four days after the death of her husband and son in battle, having spent her last years promoting Roman Christianity in the Scottish church.

St Margaret’s Chapel survives today as the oldest building in Edinburgh — and one of the few medieval Norman structures in Scotland to remain in continuous use. Its small rectangular interior measures just 10.5m by 4.8m, with a chevron-decorated chancel arch and stained-glass windows added in the 1920s. For visitors today, it is often the most quietly affecting space inside the castle complex.

David I, alongside building the chapel, established Edinburgh as one of his royal burghs around 1130, beginning the formal organisation of the town beneath the castle into a chartered settlement. The castle in this period would have been largely a complex of timber buildings within a stone curtain wall, with continuous royal occupation when monarchs were in the Lothians.

Historic stone walls of Edinburgh Castle showing its layered history
The layered stone walls of Edinburgh Castle tell a story spanning ten centuries.

The Wars of Scottish Independence (1296-1357)

The most consequential period in the castle’s medieval history began in 1296. King Edward I of England, in his attempt to dominate Scotland, captured Edinburgh Castle after a three-day siege in March 1296. The English garrison would hold the castle for the next 18 years.

The Recapture of 1314

One of the most legendary episodes in Scottish military history occurred on the night of 14 March 1314. Thomas Randolph, Earl of Moray and nephew of King Robert the Bruce, led a 30-man assault party up the supposedly unscalable north face of Castle Rock. According to the Scottish chronicler John Barbour (writing in the 1370s), Randolph’s men were guided by William Francis, a former garrison soldier who had previously climbed the cliff at night to visit a girl in the city below. The Scots reached the summit, surprised the English garrison, and recaptured the castle for Robert the Bruce. King Robert immediately ordered the castle’s defences slighted (deliberately damaged) to prevent the English from holding it again — a remarkable strategic decision that reflected the realities of medieval Scottish warfare.

Three months later, in June 1314, Robert the Bruce decisively defeated Edward II at the Battle of Bannockburn, securing Scottish independence in practice if not yet in formal treaty.

The Reconstruction Under David II

The slighted castle remained largely ruined for decades. King David II (son of Robert the Bruce, born 1324) began reconstruction in the 1360s, building David’s Tower — a massive L-shaped tower house that dominated the eastern approach. Completed around 1376, David’s Tower was the central structure of the castle for the next 200 years until its destruction in the Lang Siege of 1573. Its foundations are still visible inside the Half Moon Battery, where they were rediscovered during 19th-century excavations.

Medieval knights in armour reenacting battles of Edinburgh Castle
Edinburgh Castle was besieged 26 times in 1,100 years — more than any other fortress in Britain.

The Stewart Royal Castle (1424-1542)

The 15th and early 16th centuries saw Edinburgh Castle transition from a primarily military stronghold to a major royal residence under the Stewart kings.

James II and Mons Meg

King James II of Scotland (1437-1460) received as a wedding gift from his uncle, Philip the Good of Burgundy, one of the most extraordinary medieval cannons ever made: Mons Meg. Forged in Mons, Flanders in 1449 and presented in 1457, Mons Meg fired stone balls weighing up to 175 kilograms over distances of more than two miles. The cannon weighs six tonnes and was used in active siege warfare in the late 15th century before being retired to ceremonial duty. It cracked while firing a salute in 1681 and has been on display at Edinburgh Castle ever since.

Ironically, James II himself was killed in 1460 by a different cannon — the explosion of “the Lion” at the siege of Roxburgh Castle.

James IV and the Great Hall

King James IV (1488-1513) was the architect of much of the castle as visitors see it today. The Great Hall, completed in 1511, remains one of the finest medieval halls in Scotland — and the only Scottish royal hall of the period to survive substantially intact. Its hammer-beam roof, with carved heraldic bosses, is a masterwork of late-medieval timber engineering. James IV also built the Royal Palace, expanded the artillery defences, and made Edinburgh Castle the principal royal residence in Scotland during his reign.

James IV was killed at the Battle of Flodden in September 1513, fighting Henry VIII of England. The Scottish defeat at Flodden is still one of the most consequential losses in Scottish history.

James V and the Honours of Scotland

The Honours of Scotland — the Crown, Sceptre, and Sword of State that comprise the Scottish Crown Jewels — were assembled into their current form during this period. The Crown was refashioned for King James V in 1540 from gold mined in Scotland, set with 22 gemstones including amethysts, garnets, freshwater pearls, and rock crystals. The Sceptre had been presented to James IV by Pope Alexander VI around 1494; the Sword of State was a gift from Pope Julius II to the same king in 1507. The three regalia were used together for the first time at the coronation of Mary Queen of Scots in 1543.

Mary Queen of Scots and the Birth of James VI (1542-1567)

Mary, Queen of Scots, became queen at six days old in December 1542 after her father’s death following the Battle of Solway Moss. She was crowned at Stirling Castle in 1543 and spent most of her childhood in France, returning to Scotland in 1561 as the recently-widowed Queen of France.

The single most famous event in Edinburgh Castle’s royal history occurred on 19 June 1566, when Mary gave birth to the future King James VI of Scotland (later also King James I of England) in a tiny chamber in the Royal Palace. The room is preserved today essentially as it was — with original heraldic ceiling decoration showing the arms of Mary and the infant James, and a Latin inscription celebrating the birth. The chamber is one of the smallest royal birth rooms in Europe.

James VI was just over a year old when Mary was forced to abdicate in 1567. He was crowned king of Scotland at 13 months old, and would unite the Scottish and English crowns as King James I of England in 1603 — a turning point in British history.

Scottish Highlanders in traditional dress at Edinburgh Castle
Scottish kings, queens, and highland regiments have shaped Edinburgh Castle for centuries.

The Lang Siege (1571-1573)

One of the most dramatic events in the castle’s history was the Lang Siege of 1571-1573 — a two-year struggle between supporters of the deposed Mary, Queen of Scots (the “Marian” or “Queen’s Men” faction) and supporters of the infant King James VI (the “King’s Men”).

The Marian forces, led by Sir William Kirkcaldy of Grange and supported with money from France, held Edinburgh Castle from 1571. The King’s Men were unable to dislodge them. Eventually, in 1573, an English military expedition under William Drury was sent north with heavy artillery to assist the King’s Men. After a sustained bombardment that lasted 12 days, David’s Tower collapsed and the Marian garrison surrendered on 28 May 1573. Kirkcaldy was hanged shortly afterwards at the Mercat Cross in the city below.

The destruction of David’s Tower is the reason it does not survive today. Its rebuilt successor — the Half Moon Battery — was constructed between 1574 and 1588 as a curving stone gun emplacement that would prevent any future attacker from approaching the eastern face with bombards. The Half Moon Battery is now the most prominent feature of the castle’s profile from the city.

The Civil Wars and the Honours’ Hiding (1639-1651)

The Wars of the Three Kingdoms (1639-1651) brought new violence to Edinburgh. In 1639 the castle was captured in just 30 minutes by Covenanter forces under General Alexander Leslie — one of the shortest sieges in its history. The castle changed hands again during the English Civil War, and in 1650 was besieged and captured by Oliver Cromwell’s forces after a three-month siege.

The most romantic episode of this period concerns the Honours of Scotland themselves. With Cromwell’s army threatening Edinburgh in 1651, the regalia were smuggled out of the castle and taken north to Dunnottar Castle on the Aberdeenshire coast. Dunnottar was itself besieged by parliamentary forces; just before its fall, the Honours were smuggled out a second time and buried under the floor of Kinneff Old Kirk a few miles inland, where they remained hidden for nine years.

The Honours were returned to Edinburgh Castle at the Restoration in 1660. They were used at no further coronation (the United Kingdom monarchs were crowned at Westminster), and from 1707 — after the Acts of Union — they were sealed inside an oak chest in the Crown Room and forgotten for more than a century.

The Jacobite Risings (1715, 1745)

The Jacobite Risings of 1715 and 1745 attempted to restore the Stuart dynasty to the British throne. In both risings, Edinburgh Castle was a strategic prize that the Jacobites failed to take.

1715 Rising

In September 1715, a party of around 100 Jacobites attempted to scale the castle walls at night using rope ladders thrown from the battlements by sympathisers inside. The plot was betrayed; the ladders were too short; and the attackers were repulsed.

1745 Rising

Bonnie Prince Charlie’s Jacobite army occupied Edinburgh in September 1745 but was unable to take the castle, which remained in government hands throughout the rising. The Jacobites’ subsequent defeat at the Battle of Culloden in April 1746 ended Stuart claims permanently and led to the suppression of Highland clan culture.

The Prisons of War Era (1757-1814)

From the mid-18th century, Edinburgh Castle’s role shifted from active siege fortress to garrison and prison. The vaults beneath the Queen Anne Building were converted into prisoner-of-war accommodation, holding French sailors during the Seven Years’ War (1757-63), American sailors and soldiers during the War of Independence (1775-83), and French prisoners again during the Napoleonic Wars (1799-1814). At the height of occupation in 1812, more than 1,000 prisoners were held in the vaults.

Historic cannons on Edinburgh Castle ramparts
Historic artillery still lines the castle ramparts as a reminder of its military past.

The most extraordinary episode of the prisons era occurred in 1811, when 49 prisoners escaped through a hole they had quietly excavated in a southern wall. All but one were recaptured. The escape hole is still visible today as part of the Prisons of War interpretive exhibit. Among the most fascinating artefacts to survive from the prisons are the prisoners’ own carvings on doors and walls — including ships, coats of arms, and what is sometimes claimed to be one of the earliest depictions of the American Stars and Stripes flag.

The Romantic Rediscovery: Walter Scott and the Honours (1818)

By 1818 the Honours of Scotland had been sealed in their oak chest in the Crown Room for 111 years. Many doubted they still existed. The novelist Sir Walter Scott — already an internationally famous figure for his Waverley novels — used his political connections to obtain a royal warrant to open the chest. On 4 February 1818, Scott and a small party broke open the seals. The crown, sceptre, and sword were intact.

The rediscovery sparked a wave of Romantic-era enthusiasm for Scottish history. Scott orchestrated King George IV’s state visit to Edinburgh in 1822 — the first visit by a reigning monarch to Scotland since Charles I in 1633 — staging tartan-clad pageantry that effectively invented modern “Highland” cultural identity. Edinburgh Castle, and the Honours within it, became central to a new Scottish national consciousness.

Victorian Restoration and the Tartan Tourist (1829-1900)

The 19th century brought systematic restoration. Mons Meg, which had been moved to the Tower of London in 1754, was returned to Edinburgh in 1829 after a campaign by Walter Scott. The Royal Palace, the Great Hall, and St Margaret’s Chapel were all restored under various architects in the second half of the 19th century, sometimes with more enthusiasm than archaeological accuracy.

The One O’Clock Gun was inaugurated in 1861 as a time signal for shipping in the Firth of Forth — fired daily at exactly 1pm from the Half Moon Battery. The tradition continues today, paused only for Sundays, Christmas Day, and Good Friday.

By 1900 Edinburgh Castle had become a major tourist attraction. Queen Victoria’s frequent visits to Scotland, and the broader Victorian fascination with the romance of “the North,” meant the castle was photographed, painted, and visited in unprecedented numbers.

The 20th Century: World Wars and the National War Memorial (1900-2000)

The 20th century brought a new role: the castle as the spiritual heart of Scottish military memory. The Scottish National War Memorial, designed by Sir Robert Lorimer and built within a substantially rebuilt 18th-century barracks block, was opened by King George V on 14 July 1927. It commemorates Scottish service personnel who died in the First World War — a Roll of Honour holds more than 200,000 names — and was extended after 1945 to include the Second World War and subsequent conflicts.

The memorial is the most quietly powerful space inside the castle complex. Photography is restricted out of respect; visitors generally fall silent on entering the main shrine, where a casket on a green Italian-marble plinth holds the master Roll.

Throughout the 20th century the castle continued as a working military headquarters, principally for the Royal Regiment of Scotland and its predecessors. It remains active today as the headquarters of the British Army’s 51st Infantry Brigade.

The 21st Century: Tourism, Restoration, and the Stone of Destiny’s Departure

The 21st century has seen Edinburgh Castle’s tourism numbers reach historic highs — typically more than two million visitors a year, making it the most-visited paid attraction in Scotland. Major restoration and re-presentation projects have continued: the Prisons of War were extensively reinterpreted in 2008; the Crown Room is undergoing a major refurbishment in 2026 with a redesigned display.

The most significant recent change concerns the Stone of Destiny. The ancient sandstone slab on which Scottish (and later British) monarchs were crowned for centuries had been displayed alongside the Honours in the Crown Room since 1996, when it was returned to Scotland from Westminster Abbey. After being used at the coronation of King Charles III in 2023, the Stone was moved to a new permanent display at Perth Museum in March 2024. It is no longer on display at Edinburgh Castle. For visitors who want to see the Stone today, a day trip to Perth (1.5 hours by train from Edinburgh) is required.

Ancient stone corridor inside Edinburgh Castle showing medieval history
Inside Edinburgh Castle, every stone tells part of a 1,100-year story.

Edinburgh Castle Timeline at a Glance

The full timeline, condensed:

c. 850 BC: Late Bronze Age occupation on Castle Rock.
c. 600 AD: Y Gododdin poem references Din Eidyn.
638 AD: Anglo-Saxon Northumbria captures rock.
c. 1130: St Margaret’s Chapel built by King David I.
1296: Edward I of England captures castle in 3-day siege.
1314: Thomas Randolph recaptures castle in night raid.
c. 1370: David II builds David’s Tower.
1457: Mons Meg presented to King James II.
1511: James IV completes the Great Hall.
1540: Crown of Scotland refashioned for King James V.
1543: Honours of Scotland used together at Mary’s coronation.
19 June 1566: Future King James VI born to Mary Queen of Scots.
1573: Lang Siege ends; David’s Tower destroyed.
1574-1588: Half Moon Battery constructed.
1639: Castle captured in 30 minutes by Covenanter forces.
1650: Cromwellian siege.
1651-1660: Honours of Scotland hidden under Kinneff Kirk.
1707: Honours sealed in oak chest after Acts of Union.
1715, 1745: Failed Jacobite attempts on the castle.
1757-1814: Prisons of War active.
1811: 49 prisoners escape through wall hole.
1818: Sir Walter Scott rediscovers Honours of Scotland.
1822: King George IV state visit, first since 1633.
1829: Mons Meg returned from Tower of London.
1861: One O’Clock Gun inaugurated.
1927: Scottish National War Memorial opened.
1996: Stone of Destiny returned to Scotland, displayed at Edinburgh Castle.
2023: Stone of Destiny used at Coronation of King Charles III.
March 2024: Stone of Destiny moved to Perth Museum.
2026: Crown Room refurbishment in progress.

Frequently Asked Questions

How old is Edinburgh Castle?

The earliest occupation of Castle Rock dates to about 850 BC. Continuous fortified use began around 600 AD when the Brythonic kingdom of the Gododdin held a stronghold there. The earliest standing building, St Margaret’s Chapel, was built around 1130. Edinburgh Castle is therefore older than 900 years in its present form and roughly 2,800 years old as a fortified site.

How many times has Edinburgh Castle been besieged?

A 2014 academic study identified 26 sieges of Edinburgh Castle in its 1,100-year written history — making it the most besieged fortress in the British Isles and one of the most besieged places in the world. The major sieges include the English captures of 1296 and 1573, the Scottish recapture of 1314, the Cromwellian siege of 1650, and the failed Jacobite attempts of 1715 and 1745.

Who is buried at Edinburgh Castle?

No major royal burials are at Edinburgh Castle. Saint Margaret of Wessex, Queen of Scotland and mother of King David I, died at the castle in 1093 but was buried at Dunfermline Abbey. The castle’s pet cemetery, by St Mary’s, contains military service dogs from the 19th century.

Is Edinburgh Castle haunted?

Edinburgh Castle features prominently on lists of supposedly haunted sites in Britain, with reports of phantom drummers, headless ghosts, and apparitions in the Prisons of War. Historic Environment Scotland does not promote the castle as haunted, but the dark history of plague, siege, execution, and imprisonment ensures the castle’s reputation in paranormal literature.

Was Mary Queen of Scots imprisoned at Edinburgh Castle?

No. Mary’s son James VI was born at Edinburgh Castle in 1566, but Mary herself was never imprisoned there. She was imprisoned at Lochleven Castle in 1567, escaped to England in 1568, and was imprisoned in various English castles for 19 years before her execution at Fotheringhay in 1587.

What is the oldest building at Edinburgh Castle?

St Margaret’s Chapel, built around 1130, is the oldest surviving building at Edinburgh Castle and indeed the oldest surviving building in Edinburgh as a whole. It was constructed in the Anglo-Norman Romanesque style by King David I in memory of his mother, the canonised Queen Margaret of Wessex.

When was the Great Hall built?

The Great Hall was completed in 1511 for King James IV. Its hammer-beam roof is one of the finest medieval timber ceilings to survive in Scotland, and the hall remains substantially intact almost 515 years later despite extensive Victorian restoration.

Why is Edinburgh Castle important to Scottish history?

Edinburgh Castle has been the seat of Scottish kings, the site of major sieges in the Wars of Independence, the birthplace of King James VI (the only monarch to unite the Scottish and English crowns), the safe house for the Honours of Scotland, the burial site of Saint Margaret, and the spiritual centre of Scottish military memory through the Scottish National War Memorial. It is arguably the single most historically significant building in Scotland.

Final Thoughts

Edinburgh Castle’s 1,100 years of recorded history mirror the broader story of Scotland — from independent medieval kingdom through wars of independence, religious schism, civil war, union with England, military empire, and modern devolution. Every century has left its physical mark on the rock: the Norman chapel of David I, the medieval cannon of James II, the Great Hall of James IV, the Half Moon Battery of the post-Lang-Siege years, the Prisons of War vaults, the Victorian-restored interiors, and the 20th-century war memorial.

For most visitors, knowing some of this history transforms the experience. Standing in the small chamber where Mary gave birth to James VI, or in the quiet of St Margaret’s Chapel, or on the Half Moon Battery looking down across the rock that has been fought over for a millennium, you are quite literally walking through the history of a nation.

To plan your visit, see our companion guides on Edinburgh Castle tickets, prices and opening hours, what to see inside Edinburgh Castle, and our pillar guide on Edinburgh Castle. For broader context, our Edinburgh itinerary planner and things to do in Edinburgh guides put the castle in its full city context.


Leave a Reply

Your email address will not be published. Required fields are marked *