King Magnus spent the year following his defeat mostly in Bergen, where he had many strong friends, among them Archbishop Eystein and Orm King’s-Brother (a half-brother of Harald Gille’s sons). Afterward he went to Viken, where he spent the winter and gathered an army for a new expedition against his rival. After a short stay at Nidaros, King Sverre made a levy throughout Throndhjem, and proceeded with a fleet south to Bergen; but when he arrived there Magnus had already gone to Viken. He therefore returned to Nidaros, but on his way north he installed officers in all the districts he passed. The winter of 1179-80 he spent in Nidaros.

In the spring King Magnus appeared outside of Nidaros with a force much more numerous than the one Sverre had been able to muster, and a bloody battle was fought on the plains of the Ilevolds. The battle resulted in a complete victory for Sverre. King Magnus and some of his chiefs saved themselves by flight and sailed south with a few ships.

King Magnus went first to Bergen, but soon after proceeded south to his kinsman, King Valdemar of Denmark, by whom he was well received. But Orm King’s-Brother went to Viken, and Archbishop Eystein sailed over to England, where he remained for three years. From here he had Sverre declared under the ban of the church; but Sverre does not seem to have paid any attention to this step.

About a month after the battle at the Ilevolds, King Sverre appeared with his fleet outside of Bergen. Resistance was useless, and the inhabitants gave him a good reception. He remained in Bergen all winter (1180-81), and early in the spring quelled an uprising of peasants under the leadership of Jon Kutiza. Sverre promptly punished the rebels, and the peasants had to pay heavy fines. Later in the spring King Magnus and Orm King’s-Brother came north with a strong fleet, and a battle was fought at Nordnes, near Bergen. A good many men fell on both sides; but Magnus was again defeated and compelled to save himself by flight. The Birchlegs captured eighteen of Magnus’s ships and brought them into the town. They also took other rich booty, for Magnus was at that time well supplied with money and goods.

Magnus went to Stavanger, and it was but a short time before he was again ready to attack Sverre at Bergen. This time, however, Sverre wished to avoid a battle, and sailed with his ships north to Nidaros, where he proceeded to improve the fortifications of the town. Meanwhile Magnus remained in Bergen.

During Sverre’s stay in Nidaros there came to him a young man named Erik, who claimed to be a son of King Sigurd Mund. He had been in many foreign lands, had been in the service of the emperor at Constantinople, and on a pilgrimage to the Holy Land, where he had bathed in the river Jordan. He now asked leave to prove his royal descent by the iron ordeal. After a consultation with his friends and chiefs, Sverre permitted him to undergo the ordeal upon the condition that he must not aspire to the crown. Sverre prescribed the oath to be taken by the young man in submitting to the ordeal to prove that he was the son of Sigurd Mund “and the brother of Sverre.” In this way Sverre meant to obtain incidentally a confirmation of his own title. But Erik refused to undertake to establish the descent of anybody but himself, and omitted the additional words. He successfully underwent the ordeal, and King Sverre acknowledged him as his brother, and gave him a command in his royal guard.

The conflict between Sverre and Magnus continued for three years more. In 1181 King Sverre opened negotiations for a cessation of hostilities, offering first to share the kingdom with Magnus, and afterward proposing that they should reign alternately for three years each. Magnus, however, declined all offers, and the war was continued. During the years 1181 and 1182, King Magnus made three attacks on the Birchlegs at Nidaros with varying success. In the summer of 1183 Sverre sailed with a fleet down to Bergen, where he surprised and defeated the Heklungs, and compelled Magnus to flee east to Viken. The Birchlegs did not pursue the enemy very far, but returned to Bergen, and took possession of Magnus’s whole fleet and a rich booty. Magnus’s crown, sceptre and whole coronation outfit fell into Sverre’s hands. Many men, who had heretofore been attached to Magnus, now joined King Sverre and swore him allegiance. Archbishop Eystein, who had just returned to the country after a three years’ sojourn in England, was reconciled to King Sverre, and returned to his archbishopric in Nidaros. After a short stay in Bergen, and having installed district officers in Sogn, Hordaland, and Rogaland, Sverre returned with his whole army to Nidaros. Magnus again proceeded to Denmark, where the previous year King Knut VI. had succeeded his father, Valdemar the Great, on the throne.

Magnus made a final attempt to defeat Sverre in the summer of 1184, when he came up from Denmark with a large fleet. King Sverre had sailed into the Norefjord, a narrow arm of the Sognefjord, in order to punish the inhabitants of Sogn for having killed his prefect, Ivar Darre, and some other officers. Magnus sailed in after him with his greatly superior force, and a fierce battle was fought at Fimreite, June 15, 1184. The Birchlegs fought with great heroism, and a large number of men fell. The battle commenced in the afternoon. At sundown the first Heklungs turned to flee, and at midnight the battle was finished. The Heklungs had been completely routed. Two thousand men had fallen, among them King Magnus himself and the most prominent chieftains, the flower of the aristocracy of Gulathingslag and Viken. Among the slain were Harald, the son of King Inge; Orm King’s-Brother and his son, Ivar Steig; Aasbiorn Jonson of Thiorn; Ragnvald, the son of Jon Hallkelson; Eindride Torve, Jon Kutiza’s son, and many other prominent men.

King Magnus was twenty-eight years old at the time of his death, having borne the title of king for twenty-three years. His body was found two days after the battle, and was brought to Bergen, where it was buried with great ceremony.