Danelaw
By the time of the Northumbrian king Æthelfrith's victory over the British in 616, Chester was in territory associated with the British kingdom of Powys and was perhaps the seate of a branch of the royal dynasty of the Cadelling, whose representatives were prominent in the battle. The fact that a little later lands to the south in Shropshire, were in the hands of a different dynasty suggests that the Cadelling who fought at Chester were confined to Cheshire and north Wales, and hence likely to have made use of the fortress. Under their rule too the area was ecclesiastically important. At Bangor, 1,200 of whose monks were allegedly slaughtered by the Northumbrians at the battle of Chester as they prayed for a British victory. The first raids in the British Isles was in 793, when the great monastery at Lindisfarne was sacked. In Ireland, Rathlin island monastery was burned by the Vikings in 795. The Ulaid defeated a band of raiders in 811, a band was defeated in Connaght in 812 and one in Munster around the same time. From this base they then raided extensively into the surrounding countryside for a period of several months. They pillaged monasteries, churches, the fortresses of Irish Lords, and farms. In 836 the lands of the southern Uí Néill suffered such an episode. In 837, the same thing happened on the Boyne and Liffey rivers on the east coast and on the Shannon on the west. In 840 the Vikings spent a yeare on Lough Neagh pillaging, amongst others, the monastery of Armagh. Many of the scholars and monks of Louth monastery were captured and sold into slavery. In 841 they set up fortified camps at Annagassan (county Louth) and Dubhlinn (present day Dublin). Clonmacnoise, Birr and Clonfert were pillaged and the primate of Armagh was captured and carried off in 845. Other Viking towns had also been defeated, for example Cork in 848, Vadrefjord [Waterford] in 864 and Youghal in 866.
The power of the Uí Néill rose during the 700s and this continued into the 800s. After conquering the province of Airgialla (central Ulster) between 750 and 850, the Northern Uí Néill turned their attention to the eastern province of Ulaid. The Ulaid, recognising the supremacy of the Uí Néill, did not attempt to resist and they were under Uí Néill control by the mid 800s. The Northern Uí Néill themselves were ruled by the Cenél nEógain family, and they were bitterly resented by the Cenél Conaill of western Ulster and the Ulaid in the east. The southern Uí Néill, on the other hand, had gained control over northern Laigin. Split by the expansion of Connacht into Bréifne in the 700s, the two halves of the Uí Néill were united again, in the east, by the end of the 800s. The King of the Northern Uí Néill, Domnall ua Néill, who was also the overall Uí Néill king, attempted to rule the Southern Uí Néill directly and even garrisoned forces in their territory. The next king was Mael Sechnaill II of the Southern branch. The Uí Néill had gone from being an obscure people in western Ireland to the rulers or controllers of most of northern and eastern Ireland. Although they never really exercised control over Connacht or Munster, their later proponents preferred to style them as the first High Kings.
Around the time of St Patrick, the Ulaid ruled must of North Ireland, Munster was in the south, Laigin was in the south-east and Connacht was in the west. The Uí Néill ruled an area from central-eastern Ireland to the north-western corner. The southern Uí Néill spent the early Christian period expanding eastwards at the expense of Laigin. The power of the Ulaid, whose capital was at Emain Macha (near Armagh), was slowly diminished by the "Three Collas" who drove them out of their western lands and set up the Province of Airgialla (also known as Oriel). Airgialla eventually captured Emain Macha. In response to being driven eastwards, some of the Ulaid founded a colony in Scotland. This is the colony of the Dal Riata. The Angles, Jutes and Saxons were groups of people living in what is now Denmark and northern Germany. Starting in 440AD, warriors sailed across and landed on the eastern seaboard of Celtic Britain, in ever increasing numbers. In time the Anglo-Saxons established their own separate kingdoms in Britain, and the situation in the yeare 800. The Anglo-Saxon invasion is significant for Irish history since it marks the end of the Celtic era in Britain, but its continuation in Ireland. The period 700-850 marks the growth in the influence of the Uí Néill. Their northern half was dominated by the Cenel nEoghan dynasty, who lived in the east of the territory and they went on the offensive against the province of Airgialla, driving them out of their northern territories over the century 750-850. By 804, the Uí Néill had become the protectors of the monastery of Armagh. Meanwhile, the southern Uí Néill penetrated further into Laigin in the period 700-800, driving them out of the Boyne valley and taking control of the royal site of Tara.
In the 700s, the power of Connaght rose dramatically, and they began to expand eastwards, further dividing the northern and southern Uí Néill and founding the secondary province of Bréifne around present-day Cavan and Leitrim. This had the additional effect of splitting the Uí Néill into two parts, referred to simply as the Northern Uí Néill and the Southern Uí Néill.
In 893 Vikings raided Chester, then 'a deserted city in Wirral'. The history of medieval Chester can be said to begin only in 907 with the refortification of the site by the rulers of Mercia, King Alfred's daughter Æthelflęd. The background to that event was the establishment of a Hiberno-Norse community in Wirral after its expulsion from Dublin in 902. It seems that the exiles, led by Hingamund, were granted land in Wirral by Æthelflęd and her husband Æthelred but soon afterwards cast covetous eyes on the wealth of Chester, only to be repulsed by the great army which she assembled in the city. A second phase of raiding began in 914, with the arrival of a large fleet of Viking ships in Waterford harbour. They plundered the monasteries of Cork, Lismore and Aghaboe, among others.