THIS week sees the 550th anniversary of one of the most important marriages in Scottish history, one that really did change the face of Scotland.

On July 13, 1469, James III, King of Scots, married Princess Margaret of Denmark in a magnificent ceremony at Holyrood Abbey in Edinburgh. The groom was around 17, the bride was 13, but such youthful marriages were not only legal in Scotland at that time, they were actively encouraged, especially when royalty was involved.

As usual with Scottish history of the period, we do not know the exact details of the wedding, and the date has largely been calculated by guesswork as so many Scottish royal records disappeared at the time of the Reformation, or were frankly stolen by Oliver Cromwell at the time of the first imposed Union in the 1650s.

It was the astonishing and accidental by-product of the marriage that altered Scotland forever, for as we shall see, it resulted in a large expansion of Scotland’s territory – one that has had huge implications over the past five centuries, and perhaps especially in the past 50 years.

Back in the day: England's history is proof of how independent Scotland was

The marriage itself was important as it secured a very strong dynastic connection between Scotland and Denmark, and James and Margaret would go on to have three sons, the eldest of whom would become James IV and inherit his father’s throne in dreadful circumstances – see Back In The Day in Tuesday’s National for the details.

James was the son of James II and Marie de Guelders, who we know as Mary of Guelders. I will tell the story of how James II died in Back In The Day this Tuesday, but suffice to say that his son became James III after his father’s sudden death on August 3, 1460, when he was eight or nine years old – maddeningly we don’t know his exact date of birth, but it was either in July, 1451 or May, 1452 – for convenience sake we will go with the former date.

James’s mother became regent for him after the nine-year-old boy king was crowned at Kelso Abbey in August 1460.

Mary lasted only three years as regent, dying in 1463. By then, James had already been linked to various marriage plans, including to an English heiress, the Stewarts as always in need of money.

Archbishop James Kennedy of St Andrews and his brother Gilbert, Lord Kennedy, took over the regency, but it was their successor, Robert, Lord Boyd, and his family who negotiated the marriage between James III and Margaret of Denmark.

She was the only daughter of King Christian I who ruled over Denmark and Norway and had previously also been King of Sweden. The beautiful Margaret would become a very popular queen, much more popular than her husband, who was rumoured to have poisoned her when she died at Stirling Castle in July 1486.

It was through the Norwegian connection that Christian was the ruler of Orkney and Shetland, but as a Norwegian possession the islands had become increasingly less important in the Danish empire, and indeed were becoming more Scottish with every passing year, though the people of Shetland in particular continued to speak Norwegian.

Now the Boyds saw an opportunity to profit from the islands’ remaining connection to Denmark, which under Danish law was “udal” rather than feudal – Christian owned the people, not the land.

In the Treaty of Copenhagen in 1468, it was agreed that Margaret would marry James III and bring a dowry of 60,000 guilders – a huge sum in those days. The Boyd ambassadors shrewdly bargained what was in effect a mortgage on the dowry – Orkney and Shetland, though whether Christian had the right to pawn the islands was dubious to say the least.

The first 10,000 guilders was to be paid immediately upon the wedding and, crucially, it was to be paid in currency. But Christian I was in deep financial trouble and could not raise even the initial sum for the dowry.

James III, having dispensed with the Boyds and now ruling the country himself, got the Scottish Parliament involved and on February 20, 1472, the kingdom of Scotland legally annexed Orkney and Shetland by dint of the fact that Christian I had not paid the dowry. James had also done a deal with the hereditary Earl of Orkney, William Sinclair, who was given lands in Fife in exchange for relinquishing his Orkney rights to the Crown.

Back in the day: The genius of a Scottish innovator that soared through the skies

Under the Treaty of Copenhagen, Denmark had retained the right to reclaim the islands on payment of huge sums of gold and silver, and numerous attempts were made by the Danes to do so, right up until 1660.

In effect, however, Orkney and Shetland became Scottish in 1472, and have remained so ever since, despite talks of breaking away.

Without them, Scotland would be a very different place, not least because the Scottish oil and gas industry of the past 50 years would not have been anything like the same.

People in Shetland really know the tale – an excellent new bistro in Lerwick is called The Dowry, so kudos to the owners for knowing their history.

James III would meet a grisly end after the Battle of Sauchieburn in 1488, which saw victory for the forces led by his own son. But that will be a tale for Back In The Day on Tuesday, continuing a short series on the early Stewart kings and the horrendous deaths they suffered themselves and caused to others.