The chief foreign policy of Haakon was now to retrieve Sweden from the Germans and his father from captivity. He was still in possession of West Sweden and found that he could rely on the support from several noblemen who were displeased with the Germans. The war between Norway and Sweden continued, and Haakon soon found himself in need of allies. He entered into an alliance with King Valdemar, the father of his wife, which was something that later would dramatically concentrate the Norwegian foreign policy to the east, rather than to the traditional west. After a turbulent conflict and war against the North German cities and the Hanseatic League, Haakon was again free to turn his attention to Sweden, and launched a successful campaign against the Germans in Sweden. The military campaign ended in the Siege of Stockholm in 1371, where it looked like Haakon could decisively defeat the Germans and acquire revenge for his defeat at the Battle of Gataskogen; but Albert and his German supporters managed to withstand the siege and Haakon was forced to sign a peace treaty. The treaty was signed on 14 August 1371, and Haakon would have to be content with having his father released from captivity against a large ransom. When released, Magnus resumed ruling his remaining domains in Norway and Sweden until his death in 1374 only three years later.