The Bagli Party or Bagler (Old Norse: Baglarr, Norwegian Bokmål: Bagler, Norwegian Nynorsk: Baglar) was a faction or party during the Norwegian Civil Wars. The Bagler faction was made up principally of the Norwegian aristocracy, clergy and merchants. 
It was formed in Skåne, then part of Denmark, in 1196 principally by Bishop Nicholas Arnesson of Oslo and Archbishop Erik Ivarsson (ca. 1130–1213) of Nidaros around the pretender Inge Magnusson (nicknamed the Baglar-King) to depose King Sverre Sigurdsson. It contested with the Birkebeiners, essentially a faction of peasants, led by the pretender King Sverre, for control in a Norwegian civil war during the late 12th century. Sverris saga provided Sverre a royal lineage as putative bastard son of the late king Sigurd II of Norway, which in the Norway of the time provided him a claim to the throne. Historians generally agree with the consensus of his time that he was a pretender/ impostor.
The civil wars period of Norwegian history lasted from 1130 to 1217. During this period there were several interlocked conflicts of varying scale and intensity. The background for these conflicts were the unclear Norwegian succession laws, social conditions and the struggle between church and king. There were then two main parties, firstly known by varying names or no names at all, but finally condensed into parties of Bagler and Birkebeiner. The rallying point regularly was a royal son, who was set up as the head figure of the party in question, to oppose the rule of the king from the contesting party.
From a socio-historical perspective, Bagler can be interpreted as conservatives against the results of developments such as the rapid increase in landless border men (markamenn), who settled along the Swedish border and made their living by pillaging the rich old settlements. That lawless population became the foremost basis of the Birkebeiner. Bagler also favoured the church and its privileges and possessions.
Viken and Vestlandet, where social distinctions were growing deeper, were gaining more power at the expense of Trøndelag, a region where the social tensions were not as marked. The wealthier classes, particularly in Viken, were the basis of the Bagler party. The powerful old Trønder families were simply being left behind by their peers in the south, who had acquired a strong leader in the Vestland earl Erling Skakke in the mid-12th century. The antecedents of the Bagli party had been supporting the rule of King Inge I of Norway and after him, King Magnus V of Norway (killed 1184) and the latter's father and regent, earl Erling Skakke (killed 1179).
The Birkebein faction had been formed in 1174 to depose Magnus and Erling. The Birkebeiner continued earl Erling's centralization which underscores the geographical motivations behind the conflicting parties. The Birkebein policy during Sverre did not seek a social revolution, only to move the centre of power back to Trøndelag. 
Around the year 1200, these rival groups shared the identical but opposite goal of controlling the entire country. King Sverre managed to acquire control of much of Norway, but in Hedmark and Østerdal, the Baglers remained powerful. Upon Sverre's death in 1202, the Bagler power increased. Sverre's successor, King Haakon III of Norway, died after a two-year reign in 1204, leaving his posthumous son Haakon Haakonsson in Hamar, which was under Bagler control. In 1206, a group of the Birkebeiners set off on a dangerous voyage through treacherous mountains and forests, taking the now two-year-old Haakon Haakonsson to safety in Trondheim. Norwegian history credits the Birkebeiners' bravery with preserving the life of the boy who later became King Haakon IV of Norway.
The Birkebeins managed to hold some power, despite short reigns of their monarchs after Sverre. In 1209, a pact was made between Bagler and Birkebeiner, which recognized Bagler pretender Philip Simonsson as ruler of Oppland and Viken in Eastern Norway, without the title of king, and recognized Birkebeiner's Inge Bårdsson as King Inge II of Norway. They both died in 1217 and Birkebeiner-born Haakon IV ascended the throne, relatively unopposed, under the regency of Duke Skule Baardsson. Later in 1240, Haakon IV ended the civil wars and weakened the role of the aristocracy in Norway.