In 1468 Orkney and Shetland were pledged by Christian I, in his capacity as king of Norway, for the payment of the dowry of his daughter Margaret, betrothed to James III of Scotland, and as the money was never paid, their connection with the crown of Scotland has been perpetual. In 1471 James bestowed the castle and lands of Ravenscraig in Fife on William, earl of Orkney, in exchange for all his rights to the earldom of Orkney, which, by act of parliament, passed on 20 February 1472, was annexed to the Scottish crown.