After Offa built his dyke in the eighth century, the border between the Anglo-Saxons and the Welsh remained fairly stable. There were wars - the Welsh gained a little ground in the north, the English a little in the south - but there was also cooperation against the Vikings. In the tenth century, the sons and grandsons of Alfred the Great of Wessex unified the Anglo-Saxons and the kingdom of England was born. England was self-evidently the strongest kingdom in Britain and its kings came to exercise a real but undefined hegemony over its Celtic neighbours. The Armes Prydein (‘The Prophecy of Britain’), a Welsh poem composed c. 930, called on the Celts of Britain, Brittany and Ireland to unite with the Vikings of Dublin and drive the English out of Britain. In 937 the Scots, the Britons of Strathclyde and the Dublin Vikings did unite against the English, but their crushing defeat at the battle of Brunanburh (location unknown) was a convincing demonstration of English power. The English hegemony was played out symbolically in 973 when King Edgar was rowed along the river Dee at Chester by eight kings from Wales, Strathclyde, Scotland and the Isle of Man while he steered the boat.
The mountainous terrain of Wales did not encourage national unity. The areas of fertile land were widely scattered and each naturally tended to become the focus of an independent dynasty. The Severn valley was the heartland of Powys; Gwynedd’s was Anglesey and so on. Nevertheless, the number of Welsh kingdoms tended to decline as the stronger ones took over the weaker. From nine in 900, there were only three major Welsh kingdoms left by 1000: Gwynedd in the north, Powys in mid-Wales and Deheubarth in the south-west, plus three minor kingdoms in the south-east that were more often than not dependencies of the larger kingdoms. Individual Welsh kings, like Hywel Dda (r. c. 900-50) of Deheubarth and Gruffydd ap Llywelyn (r. 1039-63) of Gwynedd, achieved positions of overlordship over most, or, in Gruffydd’s case, even all, of Wales but, like the high kings of Ireland, they never exercised direct rule throughout their dominions, ruling indirectly through their vassal kings. These overlordships never lasted more than a generation. Partly this was because of the Welsh practice of partible inheritance, partly because succession disputes were common as nephews and cousins as well as sons were eligible to succeed to kingship, and partly because of English intervention. The English did their best to keep the Welsh disunited but they appear to have had no territorial ambitions in Wales. For instance, when Gruffydd ap Llywelyn’s ambitions became too big for Wales alone, Harold Godwinson (the future King Harold) invaded and restored the independence of his subject kingdoms. Gruffydd himself was hunted down and killed but no territory was taken.