The Anglo-Saxons believed that Wessex was founded by Cerdic and Cynric, but this may be a legend. The two main sources for the history of Wessex are the Anglo-Saxon Chronicle and the West Saxon Genealogical Regnal List, which sometimes conflict. Wessex became a Christian kingdom after Cenwalh was baptised and was expanded under his rule. Cædwalla later conquered Sussex, Kent and the Isle of Wight. His successor, Ine, issued one of the oldest surviving English law codes and established a second West Saxon bishopric. The throne subsequently passed to a series of kings with unknown genealogies.
During the 8th century, as the hegemony of Mercia grew, Wessex largely retained its independence. It was during this period that the system of shires was established. Under Egbert, Surrey, Sussex, Kent, Essex, and Mercia, along with parts of Dumnonia, were conquered. He also obtained the overlordship of the Northumbrian king. However, 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, usurped the throne, the kingdom was divided to avoid war. Æthelwulf was succeeded in turn by his four sons, the youngest being Alfred the Great.
Wessex was invaded by the Danes in 871, and Alfred was compelled to pay them to leave. They returned in 876, but were forced to withdraw. In 878 they forced Alfred to flee to 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 to building ships, organising an army and establishing a system of burhs. Alfred's son, Edward, captured the eastern Midlands and East Anglia from the Danes and became ruler of Mercia in 918 upon the death of his sister, Æthelflæd. Edward's son, Æthelstan, conquered Northumbria in 927, and 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 Godwinson reunited the earldom with the crown and Wessex ceased to exist.
Modern archaeologists use the term Wessex culture for a Middle Bronze Age culture in this area (c. 1600–1200 BC). A millennium before that, in the Late Neolithic, the ceremonial sites of Avebury and Stonehenge were completed on Salisbury Plain; but the final phase of Stonehenge was erected in the Wessex culture phase, early in the Bronze Age. This area has many other earthworks and erected stone monuments from the Neolithic and Early Bronze periods, including the Dorset Cursus, an earthwork 10 km (6 mi) long and 100 m (110 yd) wide, which was oriented to the midwinter sunset. Although agriculture and hunting were pursued during this long period, there is little archaeological evidence of human settlements. From the Neolithic onwards the chalk downland of Wessex was traversed by the Harrow Way, which can still be traced from Marazion in Cornwall to the coast of the English Channel near Dover, and was probably connected with the ancient tin trade.
During the Roman occupation starting in the 1st century AD, numerous country villas with attached farms were established across Wessex, along with the important towns of Dorchester and Winchester (the ending -chester comes from Latin castra, "a military camp"). The Romans, or rather the Romano-British, built another major road that integrated Wessex, running eastwards from Exeter through Dorchester to Winchester and Silchester and on to London. The early 4th century was a peaceful time in Roman Britain. However, following a previous incursion in 360 that was stopped by Roman forces, the Picts and Scots attacked Hadrian's Wall in the far north in 367 and defeated the soldiers stationed along it. They devastated many parts of Britain and laid siege to London. The Romans responded promptly, and Count Theodosius had recovered the land up to the Wall by 368.