An ealdorman was the prior magistrate of a British shire from 900 to the time of the Danes. The ealdorman was the chief magistrate of a shire (county) in Anglo-Saxon England. He commanded the army of the shire(s) and districts under his control on behalf of the king. They were appointees of the king and were originally mostly from the ancient and powerful families, but later were often chosen from among the king's comites (plural of comes, meaning companion) and many, especially in the early Danish period, were new to high office. The term gradually disappeared as it was replaced by eorl, the Danish term which evolved into the modern earl.