History of Scotland
Rise of the Kingdom of Alba:
Kenneth MacAlpin, legendary founder of the royal dynasty that would rule Scotland until the wars of independence, began his reign as Kenneth I of the Picts in 843. He sat on the throne of Dal Riata for at least two years before ascending power in Pictavia, however; one theory is that the institution of Pictish kingship, being inherited through matrilineal succession, provided the basis for this merger between the Gaelic and Pictish kingships. During the reign of this dynasty, notable clans and families began to emerge.
Viking invaders began making inroads into Scotland in the 9th century, extending their control over the Shetlands, Orkney, the Hebrides, the Isle of Man, and parts of Caithness and Sutherland. They would retain a considerable presence in the islands until 1266, when the Norse king ceded the Kingdom of Man and the Isles, with all territories on the Scottish mainland, to Alexander III of Scotland. Shetland and Orkney remained Norse Jarldoms until Christian I of Norway passed them to James III of Scotland as the dowry for his daughter, to whom James was betrothed.
Constantine II, Kenneth MacAlpin's grandson, became King of the Picts some time around 890. Their kingdom damaged by Viking invaders to the point of near collapse, Picts and Gaels united to defend Pictavia and Dal Riata. In 904, Constantine and his armies massacred the Vikings at Strathcarron, saving the kingdom from foreign conquest. Constantine's first priority was to rebuild and restructure his kingdom: having grown up under the care of monks in Ireland, he remodeled the church along Gaelic lines and split the kingdom into earldoms so that it could be defended more efficiently. Dal Riata, the kingdom of the Scots, and Pictavia, reshaped through a lengthy process of Gaelicisation, joined in union to give birth to the Kingdom of Alba, the Scottish nation.
All across Britain, Viking influence was in decline. In 928, Athelstan, the Anglo-Saxon King of Wessex, conquered the Viking Kingdom of York. Intent on subduing the whole of Britain, he continued his march north, forcing the Viking Earls of Northumbria and the Kings of Strathclyde to acknowledge him as overlord. With forces amassed from the kings and chieftains of these conquered lands, Athelstan marched on Alba. Constantine, overwhelmed by such a colossal army, retreated to the rock fortress of Dunnottar. Unable to engage Athelstan militarily, Constantine instead retaliated with cunning diplomacy: he gave his daughter in marriage to Olaf Guthfrithsson, the Norse-Gaelic King of Dublin, and persuaded Owein I of Strathclyde, the king's relative, to join him in an alliance.
In 937, the combined forces of Alba, Dublin, and Strathclyde invaded Athelstan's England. At the Battle of Brunanburh, the Angles, Vikings, and Albans engaged in one of the bloodiest and largest battles of the Middle Ages. Despite an English victory, Constantine's network of alliances successfully blocked Athelstan from expanding northward. Having secured Alba's borders, Constantine retired in 943 after forty-three years on the throne to live out the remainder of his life as a monk at St. Andrews.
While Gaelic and Norman customs mixed in the east, Norse influence was coming to a close in the Western Isles. Following a small war, Haakon V of Norway signed the Western Isles and the Isle of Man over to Alexander III of Scotland in 1266, retaining only Orkney and Shetland. Alexander's daughter Margaret married Eric II of Norway in 1281, uniting the two countries in royal blood ties. When Alexander died in 1286, his three-year-old granddaughter from that marriage, Princess Margaret, was named his heir.
Edward I of England, who had his eyes set on subjugating on his northern neighbor, suggested to Margaret's father, Eric II of Norway, that she should be betrothed to his son, five-year-old Edward of Caernarvon and heir to the English throne. The Guardians of Scotland, a group of noblemen who acted as the de facto heads of state during the young queen's minority, did not have the power to deny the marriage, but were able to secure Scotland's future with the Treaty of Brigham. Any offspring of a marriage between Margaret and Edward would be heir to the crowns of both England and Scotland - the treaty provided a provision that Scotland would "remain separate, apart and free in itself without subjection to the English Kingdom," should such an heir ascend to power.
Margaret was sent to Scotland in September 1290, as per the Treaty of Brigham's agreement that she would arrive before 1 November. However, she died en route at the Orkney Islands, leaving Scotland's throne without an uncontested successor.