If Edinburgh's military history began centuries before, the earliest City Charter now extant is that granted by King Robert the Bruce in 28th May 1329.
By this charter the Sovereign conveyed to the town the Port of Leith a troublesome heritage that lasted for five centuries.
Even then Edinburgh was hardly in the running for the position of Capital of the Kingdom; it stood too near the English Border for one thing. But events slowly drew the seat of royal authority southward and eastward - from Dunstaffnage and Inverness, to Dunkeld and Forteviot, to Perth, Dunfermline, and Stirling, and finally to Edinburgh.
The Bruce began holding parliaments here which, under him and the Stuarts, met in the banqueting hall of the Castle or in the Tolbooth.
When James IV. and his son began building the Palace in the King's Park and establishing a brilliant Court in the quarters from which they had ousted the monks, Edinburgh's claim to be the centre of royal authority and of Scottish national affairs may be said to have been assured.
The First Town Wall, encircling the ridge between the Nor' Loch and the Cowgate valley, was built in 1450; the wider cincture of the Flodden Wall arose hastily after the disaster on the Till.
In 1532 the Court of Session was founded; Scotland had a stationary tribunal of law, planted in the High Street.
Scotland and Edinburgh had not too much experience of law and justice, on the practical side. In the early sixteenth century, and for long afterwards, the family feuds and clan and faction quarrels of the nation were fought out in the streets of the Capital.
Then came with the Reformation an embitterment of strife. Edinburgh was the storm centre of a distracted kingdom. To the horrors of civil war were added those of foreign invasion.
In 1544, an English host, under Hertford, burnt the city and the Abbey; he returned, as Protector Somerset, three years later, and, after Pinkie, wasted and pillaged Leith.
Next page: John Knox