When the Danes tried to take over the whole of England, King Alfred of Wessex, in southern England, was the strongest Anglo-Saxon ruler.
To begin with Alfred could not get enough men together and he was beaten by Viking King Guthrum.
However, in 878 Alfred struck back and defeated the Danes at the Battle of Edington. As a result, the Danes and the Saxons divided England between them. The Danish part was called the Danelaw.