The Kingdom of the West Saxons, usually referred to as Wessex, was an Anglo-Saxon kingdom in the south of Great Britain, from 519 until the emergence of a unified English state during the early 10th century.
The Anglo-Saxons believed that Wessex was founded by Cerdic and Cynric, but it is possible that this account is a legend. The two main sources for the kings of Wessex are the Anglo-Saxon Chronicle and the West Saxon Genealogical Regnal List, which conflict and cannot be fully reconciled. After Cenwealh was baptised, Wessex became a Christian kingdom. His conversion may have been connected with an alliance against Penda of Mercia, who had attacked Wessex and forced him into temporary exile. During Cenwealh's rule the territory of the West Saxons was expanded. A later king, Cædwalla, conquered Sussex, Kent and the Isle of Wight. His successor, Ine, issued one of the oldest surviving English codes of laws and established a second West Saxon bishopric. After Ine, the throne then passed to a series of kings with unknown genealogies.
During the 8th century, as the hegemony of Mercia grew, the kings of Wessex were largely able to maintain their independence. It was during this period that the West Saxon system of shires was established. The fortunes of the kingdom were transformed when Egbert conquered part of Dumnonia, seized control of Surrey, Sussex, Kent and Essex, conquered Mercia and secured the overlordship of the Northumbrian king, although Mercian independence was restored in 830. During the reign of his successor Æthelwulf, a Danish army arrived in the Thames estuary but was decisively defeated. When Æthelwulf's son Æthelbald ascended to the throne, the kingdom was divided to avoid bloodshed. Æthelwulf was succeeded in turn by his four sons, the youngest being Alfred the Great.
When Wessex was invaded by the Danes in 871, Alfred was compelled to pay them to leave the kingdom. They returned in 876, but were then made to withdraw. In 878 they forced Alfred to seek refuge in the Somerset Levels, but were eventually defeated at the Battle of Edington. During his reign Alfred issued a new law code, gathered scholars to his court and was able to devote funds in building ships, organising an army and establishing a system of burhs. His son Edward captured the eastern Midlands and East Anglia from the Danes and became ruler of Mercia in 918 upon the death of Æthelflæd, his sister. After Edward's son Athelstan conquered Northumbria in 927, England became a unified kingdom for the first time. Cnut the Great, who conquered England in 1016, created the wealthy and powerful earldom of Wessex, but in 1066 Harold II reunited the earldom with the crown and Wessex then ceased to be a political unit.