The Viking Kingdom
For the best part of a century large parts of the north and east of England were ruled by Viking kings based in York. On the other side of an unstable boundary, the south and west were held by a succession of English kings.
Before 850 Viking attacks had been short and sharp but in that year for the first time they stayed in Britain through the winter, on the Isle of Thanet near London. By 866 they were well established and had gathered a great army. That year they marched north and took an incredible prize, the royal city at the heart of the kingdom of Northumbria - York.
In 870 the kingdom of East Anglia fell to the Vikings and Mercia followed in 874. In the following years the Vikings secured the land around York, settling and farming it. York itself was now effectively the capital of a new Viking kingdom - the Danelaw.
The borders were never very clear nor secure and the Viking kings faced attacks from both the Saxons in the north and the English kings, particularly of Wessex in the south. Indeed one English king, Athelstan, took control of York in 927 and was the accepted ruler of most of the country until his death in 940. For the next 15 years, York was again ruled by a succession of Viking kings.
The last of these was the famous Eric Bloodaxe who was defeated in 954. From then on, York and Northumbria were always part of a united Anglo-Saxon kingdom.