A map of the routes taken by the Great Heathen Army from 865 to 878
York had been founded as the Roman legionary fortress of Eboracum and revived as the Anglo-Saxon trading port of Eoforwic. It was first captured in November 866 by Ivar the Boneless, leading a large army of Danish Vikings, called the "Great Heathen Army" by Anglo-Saxon chroniclers, which had landed in East Anglia and made their way north, aided by a supply of horses with which King Edmund of East Anglia bought them off and by civil in-fighting between royal candidates in the Anglian Kingdom of Northumbria between the leaders of its two sub-kingdoms; Bernicia and Deira. Declaring a truce, the rivals for the throne of Northumbria joined forces but failed to retake the city in March 867, and with their deaths Deira came under Danish control as the Kingdom of Northumbria and the Northumbrian royal court fled north to refuge in Bernicia.
A Viking attempt against Mercia the same season failed, and in 869 their efforts against Wessex were fruitless in the face of opposition from Kings Ethelred and Alfred the Great. The archbishop, Wulfhere, seems to have temporised and collaborated with the Norse, for he was expelled from York when a Northumbrian uprising in 872 was only temporarily successful; he was recalled and held his seat until his death. The Viking king Guthred was buried in York Minster, a signal that he and the archbishop had reached a lasting accommodation. All the Viking coinage appears to have emanated from the mint at York, a mark of the city's unique status in Northumbria as an economic magnet. York's importance as the seat of Northumbria was confirmed when the Scandinavian warlord, Guthrum, headed for East Anglia, while seized power in AD 875. While the Danish army was busy in Britain, the Isle of Man and Ireland, the Swedish army was occupied with defending the Danish and Swedish homelands where Halfdan's brothers were in control.
Native Danish rulers who eventually made Jelling in Jutland the site of Gorm the Old's kingdom, were in the East Anglian kingdom. The Five Burghs/Jarldoms were based upon the Kingdom of Lindsey and were a sort of frontier between each kingdom. King Canute the Great would later "reinstall" a Norwegian dynasty of jarls in Northumbria (Eric of Hlathir), with a Danish dynasty of jarls in East Anglia (Thorkel). Northern England would continue to be a source of intrigue for the Norwegians until Harald III of Norway's death at the Battle of Stamford Bridge in 1066 just prior to the Battle of Hastings and the Norman conquest.
The Old Norse placename Konungsgurtha, Kings Court, recorded in the late fourteenth century in relation to an area immediately outside
the site of the porta principalis sinistra, the west gatehouse of the Roman encampment, perpetuated today as King's Square, which nucleates the Ainsty, perhaps indicates a Viking royal palace site based on the remains of the east gate of the Roman fortress. New streets, lined by regular building fronts for timber houses were added to an enlarging city between AD 900 and 935, dates arrived at by tree-ring chronology carried out on remaining posts preserved in anaerobic clay subsoil.
The Viking kingdom was fully absorbed into England in 954. After the Kingdom of Northumbria was remerged (by now an Earldom of England under the House of Wessex), the title King of Jórvík became redundant and was succeeded by the title Earl of York, created in 960. Loss of political independence did not cramp the region's economic success: by ca 1000, the urban boom brought the city to a population total second only to that of London within Great Britain.
Although some of the early Earls of York were Nordic like the Jórvík Kings, they were succeeded by Normans after the Norman conquest. William the Conqueror ended the region's last vestiges of independence and established garrisoned castles in the city. The Earldom of York was abolished by King Henry II.
Between 1070 and 1085, there were occasional attempts by the Danish Vikings to recapture their Kingdom of Jórvík; however, these attempts did not materialise into the return of the kingdom.
The title Duke of York, a title of nobility in British peerage, was created in 1341, but was merged with the Crown when the 4th Duke became King Edward IV. Subsequently, the title of Duke of York has usually been given to the second son of the King or Queen.