Margaret of Denmark lived from 23 June 1456 to 14 July 1486. She became the wife and Queen of James III and the terms of her dowry led to the acquisition by Scotland of Orkney and Shetland. The wider picture in Scotland at the time is set out in our Historical Timeline.
Margaret of Denmark was the daughter of King Kristian I of Denmark, Norway and Sweden, and his wife Dorothea of Brandenburg. In July 1469, at the age of 13, she married King James III of Scotland in a ceremony held at Holyrood Abbey in Edinburgh.
Margaret's dowry was 60,000 Guilders. The first 10,000 was payable in cash, and the remainder was mortgaged against Orkney. In the event, King Kristian could only find 2,000 Guilders immediately, so the missing 8,000 was mortgaged against Shetland. In the background King James III did a deal with the Sinclair family of Roslin, who were hereditary Earls of Orkney, swapping their estates in Orkney for lands around Ravenscraig Castle, in Fife. By 1472 the money owed by King Kristian had still not been paid, so the Scottish Parliament passed an Act annexing both Orkney and Shetland to Scotland. Neither the Danes nor the Norwegians accepted the annexation for centuries afterwards, but it was arguably legal and there was very little in practice they could do about it.
Margaret and James had three children, the oldest of whom would later become James IV of Scotland. Meanwhile James III was proving a poor king in a number of ways and throughout the 1470s and 1480s his popularity steadily declined. Queen Margaret died at Stirling Castle in July 1486. Rumours immediately spread across Scotland that their unpopular King had poisoned their very popular Queen. They were probably unfounded, but had an effect nonetheless. By June 1488, Scotland's nobles were again in open revolt against James: and this time they had the support of James' 15 year old son, the future James IV. James III was killed in mysterious circumstances in the aftermath of the Battle of Sauchieburn, near Stirling, and the throne passed to James IV. James III was buried alongside Queen Margaret at Cambuskenneth Abbey near Stirling, where their tomb can still be seen.