By the ninth century the many kingdoms of the early Anglo-Saxon period had been consolidated into four: Wessex, Mercia, Northumbria and East Anglia. In the eighth century, Mercia had been the most powerful kingdom in southern England, but in the early ninth, Wessex became dominant under Æthelstan's great-great-grandfather, Egbert. In the middle of the century, England came under increasing attack from Viking raids, culminating in invasion by the Great Heathen Army in 865. By 878, the Vikings had overrun East Anglia, Northumbria, and Mercia, and nearly conquered Wessex. The West Saxons fought back under Alfred the Great, and achieved a decisive victory at the Battle of Edington. Alfred and the Viking leader Guthrum agreed on a division that gave Alfred western Mercia, while eastern Mercia was incorporated into Viking East Anglia. In the 890s, renewed Viking attacks were successfully fought off by Alfred, assisted by his son (and Æthelstan's father) Edward and Æthelred, Lord of the Mercians. Æthelred ruled English Mercia under Alfred and was married to his daughter Æthelflæd. Alfred died in 899 and was succeeded by Edward. Æthelwold, the son of Æthelred, King Alfred's older brother and predecessor as king, made a bid for power, but was killed at the Battle of the Holme in 902.