During the 8th century, as the hegemony of Mercia grew, Wessex largely retained its independence. It was during this period that the system of shires was established. Under Egbert, Surrey, Sussex, Kent, Essex, and Mercia, along with parts of Dumnonia, were conquered. He also obtained the overlordship of the Northumbrian king. However, Mercian independence was restored in 830. During the reign of his successor, Æthelwulf, a Danish army arrived in the Thames estuary, but was decisively defeated. When Æthelwulf's son, Æthelbald, usurped the throne, the kingdom was divided to avoid war. Æthelwulf was succeeded in turn by his four sons, the youngest being Alfred the Great.