Scots is descended from Old Northumbrian, the northern form of Old English (while English is descended from southern dialects). Its speakers had reached the area south of the Forth by the 7th century AD.
By this time too, the Gaelic speaking Scots had come from Ireland. They extended their power till, by the 11th century, the King of Scots ruled over most of what is now mainland Scotland, with Gaelic as the dominant language.
From the 11th century, Scotland strengthened its connections with the South. In the succeeding years, and especially during the reign of David I, many Anglo-Norman noble families moved up from north-east England. Although their own language was Norman-French, that of their retainers and followers was a form of northern English with strong Scandinavian influences (still noticeable in modern Scots in words such as brae, graith, lowp and nieve).
This developing language, then known as Inglis, spread very rapidly, especially through trade in the newly-founded burghs, and soon reached most of eastern, central and south-western Scotland. By the 16th century this language was coming to be known as Scottis.