Alba, and finally into the greater Kingdom of Scotland. The Viking Age in Scotland came to an end after another 100 years. The last vestiges of Norse power in the Scottish seas and islands were completely relinquished after another 200 years. Earldom of Orkney By the mid-9th century, the Norsemen had settled in Shetland, Orkney (the Nordreys- Norðreyjar), the Hebrides and Isle of Man, (the Sudreys- Suðreyjar—this survives in the Diocese of Sodor and Man) and parts of mainland Scotland. The Norse settlers were to some extent integrating with the local Gaelic population (see Norse-Gaels) in the Hebrides and Man. These areas were ruled over by local Jarls, originally captains of ships or hersirs. The Jarl of Orkney and Shetland, however, claimed supremacy. In , King Harald Fairhair led a fleet from Norway to Scotland. In his attempt to unite Norway, he found that many of those opposed to his rise to power had taken refuge in the Isles. From here, they were raiding not only foreign lands but were also attacking Norway itself. After organising a fleet, Harald was able to subdue the rebels, and in doing so brought the independent Jarls under his control, many of the rebels having fled to Iceland. He found himself ruling not only Norway, but also the Isles, Man, and parts of Scotland. Kings of the Isles In , the Norse-Gaels of Mann and the Hebrides rebelled against Harald. A fleet was sent against them led by Ketil Flatnose to regain control. On his success, Ketil was to rule the Sudreys as a vassal of King Harald. His grandson, Thorstein the Red, and Sigurd the Mighty, Jarl of Orkney, invaded Scotland and were able to exact tribute from nearly half the kingdom until their deaths in battle. Ketil declared himself King of the Isles. Ketil was eventually outlawed and, fearing the bounty on his head, fled to Iceland. The Norse-Gaelic Kings of the Isles continued to act semi independently, in 973 forming a defensive pact with the Kings of Scotland and Strathclyde. In 1095, the King of Mann and the Isles Godred Crovan was killed by Magnus Barelegs, King of Norway. Magnus and King Edgar of Scotland agreed on a treaty. The islands would be controlled by Norway, but mainland territories would go to Scotland. The King of Norway nominally continued to be king of the Isles and Man. However, in , The