Some twenty years earlier an agreement had been made between Magnus, the King of Norway and Harthacnut, the King of Denmark stipulating that if either died without an heir his kingdom must pass to the other. Hathacnut, as son of Canute, was not only King of Denmark but had a claim to the English throne. When Harthacnut died in 1042 Magnus claimed the thrones of Denmark and England. Harold believed that this agreement gave him a claim to the English throne and so he invaded Britain in September of 1066. His forces had been added to by Tostig the exiled Earl of Northumbria. They sailed into the Humber and attacked Yorkshire. At the battle of Gate Fulford Harold and Tostig defeated Edwin, Earl of Mercia and Morcar (Tostig's brother and now Earl of Northumbria). A few days later at the battle of Stamford Bridge King Harold of England defeated Harold Hardrada and Tostig who were both killed.