The history of Edinburgh Castle is closely entwined with the history of Edinburgh - and of Scotland as a whole.
It's easy to see why. Edinburgh Castle literally dominates the skyline of Edinburgh - it's a fearsome demonstration of Scottish might, crouched on a massive rocky outcrop at the centre of the city.
Although I wouldn't rate Edinburgh as one of my favourite castles in Europe, there's no denying the castle's place in the history of Scotland, and indeed of the whole of the UK. That's in addition to the amazing views it affords across the city.
To help explain the significance of this mighty military citadel, here's a chronological history of the castle - from inception through to modern times.
Edinburgh Castle stands on a vast chunk of volcanic rock - formed of 350-million year old molten lava, and polished into shape by wandering glaciers.
This strategic position - overlooking neighbouring lands - meant that the site was certainly used as an Iron Age fortress.
But the earliest record of a castle come in 1093 - when the Picts and the Scots established 'the castle of the Maidens' on this spot.
It was clearly already politically important - because the first Kings and Queens of Scotland, including Queen Margaret and Donald III - lived and died here.
Edward I of England was a truly fearsome King, who brought the lands of Wales into English control.
In 1290, Scotland had a crisis of succession - the next in line to the throne was a seven year-old child named Margaret, Maid of Norway. However, she died en-route back to Scotland for her coronation.
Back then, England and Scotland weren't warring nations. So Edward set up to Edinburgh to help manage the succession of the next monarch.
But his motives weren't entirely pure. Edward had successfully captured the lands of Wales, and sensed a power vacuum in Scotland. As a result, he sought to exploit the situation. In 1296, he captured the castle - as part of a risky conquest of Scotland.
His success meant that the English held the castle until 1314 - at which time it was won back by Scottish forces. Resultantly, Robert the Bruce then ordered the castle's defences to be intentionally destroyed, to prevent future occupation by the English.
However, his strategy was successful only in the short-term. The English re-captured the castle in 1335, although it was won back by the Scots in 1341.
The rule of King David II saw much of Edinburgh Castle re-built after previous squirmishes with the English.
One of his grandest works was the vast David's Tower, that would have stood more than 30m high - a tremendous height. Sadly, much of this fell in 1571, and was replaced by the dramatic curved shape of the Half Moon Battery in the 1700s.
Whereas David II helped reinstate the military strength of the castle, later Kings of Scotland sought to create a palace more suited to royalty.
James III established Edinburgh to be the true capital of Scotland, and invested large amounts of money in rebuilding and refurbishing the royal residences of the castle.
In the early 1500s, the castle took on new symbolic significance. The Honours of Scotland (the Crown, Sceptre and Stone of Destiny) were brought to the castle for safe-keeping, making Edinburgh Castle the symbolic heart of Scotland.
Mary, Queen of Scots, is remembered for her lack of political nous. In the 1570s, she was forced to abdicate as Queen of Scotland due to a number of disastrous political decisions.
However, many nobles in Scotland remained loyal to her - and so barricaded themselves in Edinburgh Castle to demonstrate their allegiance.
This was a foolish move. In 1573, Queen Elizabeth of England - increasingly exasperated with troublesome Mary - lent vast weapons to destroy part of the castle and end the occupation.
The castle was badly damaged in the siege, and Mary's sympathisers were resoundly - and bloodily - defeated. The siege was another demonstration that Mary was a liability to Elizabeth - and doubtless contributed towards her execution in 1587 for treason.
From 1642, the British Isles reverberated with the shocks of civil war. Scotland was dragged into conflict in 1644 - with the war being fought between Royalists and Covenanters.
Ironically though, it was events in Scotland that threatened to destabilise Oliver Cromwell's aspirations for an English republic.
Charles II (son of executed Charles I) arrived in Scotland in 1650. Charles II quickly assumed a large following - and threatened to unseat Cromwell.
Cromwell rushed north of the border to shore up his power, and captured Edinburgh Castle in 1650. The Scots were canny, however, and hid the symbolically important regalia of Scotland safely within Dunnottar Castle.
In 1660, Charles II was restored as King of England and Scotland. Resultantly, he set up a military garrison in the castle - which guards royal interests, even to this day.
Indeed, most of the buildings you see in the present-day castle were the result of military installations from the c17th onwards. Most of the Medieval buildings were intentionally dismantled.
In 1689, King James VIII of England and Scotland was deposed. The governor of Edinburgh Castle was a fervent supporter of James, however, and obstinately held siege inside the against the rule of William and Mary, the new King and Queen.
William and Mary quickly quashed his insolence.
But the Jacobites weren't finished. They tried to take the castle again in 1715. However their efforts were farcical. On attempting to break into the castle under the cover of darkness, their ladder was too short to climb the highest castle wall - leaving them hanging helplessly in the air, ready for capture by the patrolling officers.
They'd come close, though, and the defences of the castle were ramped up to avoid repetition in the future.
Nowadays, Edinburgh Castle has remained true to his military heritage, and is a (largely administrative) posting of the British Army.
As a result, many of the castle's attractions are military in nature, and include the Scottish War Memorial for all those fallen in battle during WWI and WWII.
Presently, the castle is Scotland's biggest tourist attraction and hosts around 1.5million visitors a year.
If you've enjoyed this, please share with others. Thanks!