The Heptarchy were the seven petty kingdoms of Anglo-Saxon England that flourished from the Anglo-Saxon settlement of Britain in the 5th century until they were consolidated in the 8th century into the four kingdoms of East Anglia, Mercia, Northumbria, and Wessex.
The term 'Heptarchy' (from the Greek ἑπταρχία, 'heptarchia'; from ἑπτά, 'hepta': "seven"; ἀρχή, 'arche': "reign, rule" and the suffix -ία, '-ia') is used because of the traditional belief that there had been seven Anglo-Saxon kingdoms, usually described as East Anglia, Essex, Kent, Mercia, Northumbria, Sussex, and Wessex.
The first known written reference to the historiographical traditional belief that there were these 'seven kingdoms' was in Henry of Huntingdon's 12th century work, Historia Anglorum; the term Heptarchy is not known to have been used to describe them until the 16th century.
By convention, the Heptarchy period 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 during this period as competing 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 during the reign of 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.