From around 800, there had been waves of Danish raids on the coastlines of the British Isles. In 865, instead of raiding, the Danes landed a large army in East Anglia, with the intention of conquering the four Anglo-Saxon kingdoms of England. The armies of various leaders had come together to provide one combined force under a leadership that included Halfdan Ragnarsson and Ivar the Boneless, the sons of the legendary Viking leader Ragnar Lodbrok. The combined army was described in the annals as the Great Heathen Army. After making peace with the local East Anglian king in return for horses, the Great Heathen Army moved north. In 867 they captured Northumbria and its capital, York, defeating both the recently deposed King Osberht of Northumbria and the usurper Ælla of Northumbria. The Danes then placed an Englishman, Ecgberht I of Northumbria, on the throne of Northumbria as a puppet ruler.
King Æthelred of Wessex and his brother, Alfred, led their army against the Danes at Nottingham, but the Danes refused to leave their fortifications. King Burgred of Mercia then negotiated peace with Ivar, with the Danes keeping Nottingham in exchange for leaving the rest of Mercia unmolested.
Under Ivar the Boneless, the Danes continued their invasion in 869 by defeating King Edmund of East Anglia at Hoxne and conquering East Anglia. Once again, the brothers Æthelred and Alfred attempted to stop Ivar by attacking the Danes at Reading. They were repelled with heavy losses. The Danes pursued, and on 7 January 871, Æthelred and Alfred defeated the Danes at the Battle of Ashdown. The Danes retreated to Basing (in Hampshire), where Æthelred attacked and was, in turn, defeated. Ivar was able to follow up this victory with another in March at Meretum (now Marton, Wiltshire).