The system was first used in the kingdom of Wessex from the beginning of Anglo-Saxon settlement, and spread to most of the rest of England in the tenth century, along with the West Saxon kingdom's political domination. In Domesday (1086) the city of York was divided into shires. The first shires of Scotland were created in English-settled areas such as Lothian and the Borders, in the ninth century. King David I more consistently created shires and appointed sheriffs across lowland "shores" of Scotland.