The civil war era in Norway ( or borgerkrigstiden) began in 1130 and ended in 1240. During this time in Norwegian history, some two dozen rival kings and pretenders waged wars to claim the throne. In the absence of formal laws governing claims to rule, men who had proper lineage and wanted to be king came forward and entered into peaceful, if still fraught, agreements to let one man be king, set up temporary lines of succession, take turns ruling, or share power simultaneously. In 1130, with the death of King Sigurd the Crusader, his possible half-brother, Harald Gillekrist, broke an agreement that he and Sigurd had made to pass the throne to Sigurd's only son, the bastard Magnus. Already on bad terms before Sigurd's death, the two men and the factions loyal to them went to war. In the first decades of the civil wars, alliances shifted and centered on the person of a king or pretender. However, towards the end of the 12th century, two rival parties, the Birkebeiner and the Bagler, emerged. In their competition for power, the legitimacy dimension retained its symbolic power, but it was bent to accommodate the parties' pragmatic selection of effective leaders to realize their political aspirations. When they reconciled in 1217, a more ordered and codified governmental system gradually freed Norway from wars to overthrow the lawful monarch. In 1239, Duke Skule Bårdsson became the third pretender to wage war against King Håkon Håkonsson. Duke Skule was defeated in 1240, bringing more than 100 years of civil wars to an end. Events of the civil war era Background The unification of Norway into one kingdom is traditionally held to have been achieved by King Harald Fairhair at the Battle of Hafrsfjord in 872, but the process of unification took a long time to complete and consolidate. By the mid-11th century the process seems to have been completed. However, it was still not uncommon for several rulers to share the kingship. This seems to have been the common way of solving disputes in cases where two or more worthy candidates for the throne existed. The relationship between such co-rulers was often tense, but open conflict was generally averted. Clear succession laws did not exist. The main criterion for being considered a worthy candidate for the throne was to be a descendant of Harald Fairhair through the male line—legitimate or illegitimate birth was