In April 871, King Ethelred died, Alfred succeeded to the throne of Wessex and the burden of its defence, despite the fact that Ethelred left two young sons. Although contemporary turmoil meant the accession of Alfred — an adult with military experience and patronage resources — over his nephews went unchallenged, he remained obliged to secure their property rights. While he was busy with the burial ceremonies for his brother, the Danes defeated the English in his absence at an unnamed spot, and then again in his presence at
Wilton in May. Following this, peace was made and, for the next five years, the Danes occupied other parts of England. However, in 876, under their new leader,
Guthrum, the enemy slipped past the English army and attacked
Wareham in Dorset. From there, early in 877, and under the pretext of talks, they moved westwards and took
Exeter in
Devon. There, Alfred blockaded them and with a relief fleet having been scattered by a storm, the Danes were forced to submit. They withdrew to Mercia, but, in January 878, made a sudden attack on
Chippenham, a royal stronghold in which Alfred had been staying over Christmas, "and most of the people they reduced, except the King Alfred, and he with a little band made his way by wood and swamp, and after Easter he made a fort at
Athelney, and from that fort kept fighting against the foe" (
Anglo-Saxon Chronicle). It has been suggested that the Christmas invasion could have been part of a coup within the witan, using Guthrum's force to enforce the coup.
A popular legend tells how, when he first fled to the
Somerset Levels, Alfred was given shelter by a peasant woman who, unaware of his identity, left him to watch some cakes she had left cooking on the fire. Preoccupied with the problems of his kingdom, Alfred accidentally let the cakes burn and was taken to task by the woman upon her return. Upon realizing the king's identity, the woman apologised profusely, but Alfred insisted that he was the one who needed to apologise. From his fort at Athelney, a marshy island near
North Petherton, Alfred was able to mount an effective resistance movement while rallying the local militia from
Somerset, Wiltshire and
Hampshire.
Another story relates how Alfred disguised himself as a
minstrel in order to gain entry to Guthrum's camp and discover his plans. This supposedly led to the
Battle of Edington, near
Westbury in Wiltshire. The result was a decisive victory for Alfred. The Danes submitted and, according to Asser, Guthrum, and twenty-nine of his chief men, received baptism when they signed the
Treaty of Wedmore. As a result,
England became split in two: the south-western half kept by the
Saxons and the north-eastern half including
London, thence known as the
Danelaw, by the Vikings. By the following year (879), not only Wessex, but also Mercia, west of
Watling Street, was cleared of the invaders.
The tide had turned. For the next few years there was peace, the Danes being kept busy in Europe. A landing in Kent in 884 or 885 close to
Plucks Gutter, though successfully repelled, encouraged the
East Anglian Danes to rise up. The measures taken by Alfred to repress this uprising culminated in the taking of London in 885 or 886, and an agreement was reached between Alfred and Guthrum, known as the
Treaty of Alfred and Guthrum. Once more, for a time, there was a lull, but in the autumn of 892 or 893, the Danes attacked again. Finding their position in Europe somewhat precarious, they crossed to England in 330 ships in two divisions. They entrenched themselves, the larger body at
Appledore, Kent, and the lesser, under
Haesten, at
Milton also in Kent. The invaders brought their wives and children with them, indicating a meaningful attempt at conquest and colonization. Alfred, in 893 or 894, took up a position from where he could observe both forces. While he was in talks with Haesten, the Danes at Appledore broke out and struck north-westwards. They were overtaken by Alfred's eldest son,
Edward, and defeated in a general engagement at
Farnham in
Surrey. They were obliged to take refuge on an island in the
Hertfordshire Colne, where they were blockaded and ultimately compelled to submit. The force fell back on Essex and, after suffering another defeat at
Benfleet, coalesced with Haesten's force at
Shoebury.
Alfred had been on his way to relieve his son at Thorney when he heard that the Northumbrian and East Anglian Danes were besieging Exeter and an unnamed stronghold on the
North Devon shore. Alfred at once hurried westward and raised the Siege of Exeter. The fate of the other place is not recorded. Meanwhile the force under Haesten set out to march up the
Thames Valley, possibly with the idea of assisting their friends in the west. But they were met by a large force under the three great ealdormen of Mercia, Wiltshire and Somerset, and made to head off to the north-west, being finally overtaken and blockaded at
Buttington. Some identify this with
Buttington Tump at the mouth of the
Wye River, others with Buttington near
Welshpool. An attempt to break through the English lines was defeated. Those who escaped retreated to Shoebury. Then after collecting reinforcements they made a sudden dash across England and occupied the ruined Roman walls of
Chester. The English did not attempt a winter blockade, but contented themselves with destroying all the supplies in the neighbourhood. Early in 894 (or 895), want of food obliged the Danes to retire once more to Essex. At the end of this year and early in 895 (or 896), the Danes drew their ships up the Thames and
Lea and fortified themselves twenty miles above London. A direct attack on the Danish lines failed, but later in the year, Alfred saw a means of obstructing the river so as to prevent the egress of the Danish ships. The Danes realised that they were out-manoeuvred. They struck off north-westwards and wintered at
Bridgenorth. The next year, 896 (or 897), they gave up the struggle. Some retired to Northumbria, some to East Anglia. Those who had no connections in England withdrew to the Continent. The long campaign was over.