In the 7th century, the Kingdom of Mercia rose to prominence under the leadership of King Penda. Mercia invaded neighbouring lands until it loosely controlled around 50 "regiones" covering much of England. Mercia and the remaining kingdoms, led by their warrior elites, continued to compete for territory throughout the 8th century. Massive earthworks, such as the defensive dyke built by Offa of Mercia, helped to defend key frontiers and towns. In 789, however, the first Scandinavian raids on England began; these Viking attacks grew in number and scale until in 865 the Danish "micel here" or Great Army, invaded England, captured York and defeated the kingdom of East Anglia. Mercia and Northumbria fell in 875 and 876, and Alfred of Wessex was driven into internal exile in 878.