On reaching Sweden, where the fame of his riches had preceded him, he entered into a league with Sweyn. The objects of this league are not very clearly defined; but we may infer that one of them was to place Harald on the Norwegian, Sweyn on the Danish throne. The wealth of Harald hired numerous adventurers; and by the two princes the coasts of Denmark were ravaged. Again Magnus prepared an armament to oppose them; but his surer recourse was policy. To detach the celebrated Varangian chief from the cause of the Dane, he offered him half of the Norwegian kingdom (and also no doubt the eventual succession), on the condition of Harald’s allowing in like manner a division of his treasure. The latter eagerly accepted the proposal; he forsook Sweyn, repaired to Norway, divided the treasure, the amount of which is described as wonderfully large, and was admitted to a share in the administration. Contrary to the usual experience of rulers so placed in regard to each other, they lived in harmony to the death of Magnus in the following year. By this defection, or rather by this conversion of an ally into an enemy, Sweyn was compelled to retire. But he had his partisans in Denmark, and Magnus, at his death, had the generosity to declare him his successor in that kingdom. To Harald was left the Norwegian throne. Thus the two adventurers became kings, in little more than a year after the arrival of Harald in the North.

The surname of Harald _the Good_, sufficiently establishes his character. He was indeed an admirable king and a virtuous man. Much praise is awarded to a code of laws which he compiled; but they no longer exist in their original form.

History of Denmark, Sweden, and Norway, Vol. II (of 2) — Part 111

As with Harda-Canute had ended the ancient male line of Denmark—a line that traced itself to Odin—Sweyn II. may be called the founder of a new dynasty. That dynasty occupied the throne to the extinction of its male line in Valdemar IV., when it was succeeded by the reigning house of Oldenburg.

History of Denmark, Sweden, and Norway, Vol. II (of 2) — Part 111

Scarcely was Sweyn invested with the dignity, when he found an enemy as powerful as Magnus, and less generous, in Harald Hardrade, who claimed the Danish crown. The assertion of this claim led to many years of warfare, ruinous to both kingdoms, but especially to Denmark, the coasts of which were often ravaged. In general the advantage rested with the Norwegian monarch, who, in 1064, obtained a great victory over the Danish fleet at the mouth of the Nissa. With great difficulty Sweyn escaped into Zealand, and began to collect a new armament. Fortunately the mind of Harald was now disposed to peace. Sixteen years of hostilities had brought him little advantage; the fortune of war was dubious; and the Danes, like their king, were averse from a foreign yoke. The two monarchs met, and entered into a treaty, which left affairs just as they had been at the death of Magnus. These were not the only hostilities in which they were engaged. Both undertook predatory expeditions to the English coast; but they could obtain no advantage over the vigilant and intrepid monarch (William I.), who now swayed the sceptre of that kingdom.[145] Sweyn too had the mortification to see his own coasts ravaged (those of Holstein) by the Vandalic pirates, who had renounced Christianity, and who laid both Sleswic and Hamburg in ashes. Before he could reach them they retired. Subsequently he was persuaded to march against the Saxons, then at war with the emperor; but his troops having no inclination to exasperate a people with whom they had long been on terms of amity, he desisted from the undertaking.

History of Denmark, Sweden, and Norway, Vol. II (of 2) — Part 111