The main Anglo-Saxon kingdoms
By convention, the Heptarchy lasted from the end of Roman rule in Britain in the 5th century, until most of the Anglo-Saxon kingdoms came under the overlordship of Egbert of Wessex in 829. This approximately 400-year period of European history is often referred to as the Early Middle Ages or, more controversially, as the Dark Ages.
Although heptarchy suggests the existence of seven kingdoms, the term is just used as a label of convenience and does not imply the existence of a clear-cut or stable group of seven kingdoms. The number of kingdoms and sub-kingdoms fluctuated rapidly as kings contended for supremacy.
In the late 6th century, the king of Kent was a prominent lord in the south. In the 7th century, the rulers of Northumbria and Wessex were powerful. In the 8th century, Mercia achieved hegemony over the other surviving kingdoms, particularly with "Offa the Great". Yet, as late as the reigns of Eadwig and Edgar (955–75), it was still possible to speak of separate kingdoms within the English population.
Alongside the seven kingdoms, a number of other political divisions also existed, such as the kingdoms (or sub-kingdoms) of: Bernicia and Deira within Northumbria; Lindsey in present-day Lincolnshire; the Hwicce in the southwest Midlands; the Magonsæte or Magonset, a sub-kingdom of Mercia in what is now Herefordshire; the Wihtwara, a Jutish kingdom on the Isle of Wight, originally as important as the Cantwara of Kent; the Middle Angles, a group of tribes based around modern Leicestershire, later conquered by the Mercians; the Hæstingas (around the town of Hastings in Sussex); and the Gewisse, a Saxon tribe in what is now southern Hampshire that later developed into the kingdom of Wessex.
The decline of the Heptarchy and the eventual emergence of the kingdom of England was a drawn-out process, taking place over the course of the 9th to 10th centuries. Over the course of the 9th century, the Danish enclave at York expanded into the Danelaw, with about half of England under Danish rule.
The English unification under Alfred the Great was a reaction to the threat by the common enemy. In 886, Alfred retook London, and the Anglo-Saxon Chronicle says that "all of the English people (all Angelcyn) not subject to the Danes submitted themselves to King Alfred."
The unification of the kingdom of England was complete only in the 10th century, following the expulsion of Eric Bloodaxe as king of Northumbria. Æthelstan was the first to be King of all England.