When Sweyn II invaded Northern England in 1069, Waltheof and Edgar Aetheling joined the Danes and took part in the attack on York. He would again make a fresh submission to William after the departure of the invaders in 1070. He was restored to his earldom and went on to marry William's niece, Judith of Lens. In 1072, he was appointed Earl of Northampton.