The Meic Uilleim (MacWilliams) were the Gaelic descendants of William fitz Duncan, grandson of Máel Coluim mac Donnchada, king of Scots. They were excluded from the succession by the descendants of Máel Coluim's son David I during the 12th century and raised a number of rebellions to vindicate their claims to the Mormaerdom of Moray and perhaps to the rule of Scotland.
William fitz Duncan himself appears to have been the acknowledged successor of Kings Alexander I and David I for part of their reigns. When David's son, Henry reached adulthood in the 1130s, William was replaced as heir apparent by Henry. In return, he appears to have been compensated with the extensive lands of Óengus, Mormaer of Moray, grandson of king Lulach, who was killed in battle against David I's general Edward the Constable in 1130. On William's death in 1147, his extensive lands in the south passed to his son by Alice de Rumilly, William of Egremont, while Moray was retained by the king.
Shortly after his death, William fitz Duncan's illegitimate son, Wimund, bishop of the Isles, attempted to gain his father's lands in Moray in a rebellion against David. He was bought off with lands in Cumbria rather than defeated outright, and was later captured, castrated and blinded by Cumbrians unhappy with his rule. Wimund, although now accepted to be a son of William fitz Duncan, is not counted among the Meic Uilleim.
It had been supposed that William's son Domnall mac Uilleim was illegitimate, but more recent histories accept that Domnall was a legitimate son of the prince, although not by Alice de Rumilly. The continuing support for the Meic Uilleim in Moray, together with their obviously Gaelic background, can best be explained by the assumption that Domnall's mother was a daughter of Óengus of Moray. Following modern historians, the Meic Uilleim were thus descended from Scots kings.