The Earls of Douglas and their successors claimed descent from
Sholto Douglas, a mythical figure dated by Godscroft to 767 AD. However, it is more likely that they were descendants of
Flemish immigrants to Scotland, during the reign of David I. Through the marriage of William the Hardy, grandfather of the 1st Earl, to Eleanor de Lovaine, The Earls of Douglas could trace their ancestry to the
Landgraves of Brabant, the
Counts of Hainaut, and through them to
Charles the Bald, grandson of the emperor Charlemagne. In the story of Sholto Douglas, his son William Douglas is a commander of forces sent by the mythical Scottish king
Achaius (Eochaid?), to the court of Charlemagne to aid him in his wars against
Desiderius, King of the
Lombards. William Douglas is said to have settled in
Piacenza where his descendants became powerful local magnates, and eventual leaders of the
Guelf faction of that city.