During the 11th century, Denmark's elective monarchy system often led to succession crises, as power was not automatically passed down to the eldest son. Sweyn II Estridsen, who fathered sixteen sons, had five of them—Harald III, Canute IV, Olaf I, Eric I, and Niels—ascend to the throne. The reign of Niels, who ruled for thirty years, was marked by a lengthy period of peace and prosperity. He was known for his frugality and piety, and he granted his nephew, Canute Lavard, the title of Duke of Schleswig, giving him opportunities to expand his influence. Canute Lavard excelled in this role, defending the southern border and subjugating the Obotrites, earning a reputation as a virtuous and honorable man. Supported by powerful allies, including the Holy Roman Emperor Lothair III, Canute was a strong candidate for the Danish throne.
Tensions erupted in 1131 when Canute Lavard was murdered by Magnus the Strong, King Niels' son, in the Haraldsted Forest. This assassination sparked a civil war as Canute's half-brother, Eric II, rallied forces to avenge him. Eric demanded that Magnus be punished, but King Niels, with support from Jutlandic nobles, decisively defeated Eric's forces at the Battle of Jellinge Heath. Forced to flee, Eric sought support from the Holy Roman Emperor, who marched north with an army to lift the siege of Schleswig. However, the emperor withdrew after reaching an agreement with Niels and Magnus, leaving Eric to face further defeats.
Despite setbacks, Eric gained support from various nobles, including Archbishop Asser Thorkilsson. In a key engagement at the Battle of Sejerø, Eric annihilated Magnus’ fleet, raiding Viborg and murdering the local bishop, Eskild. Although Eric attempted to leverage this victory, Niels managed to intercept and defeat him again, diminishing Eric's power. Niels' and Magnus’ forces continued to press their advantage, but Eric’s persistence, along with support from German merchants, enabled him to break through and capture Haraldsborg fortress.
In 1134, Eric’s fortunes changed dramatically at the Battle of Fodevig. With support from Holy Roman heavy cavalry, he decisively defeated Niels and Magnus the Strong, who was killed along with several bishops supporting their cause. Niels fled to Schleswig but was killed by locals there. Although the civil war effectively ended with Niels' death, Harald Kesja, another claimant, continued to fight until Eric captured and executed him and seven of his sons later that year.
Eric II, despite consolidating power, faced challenges and was eventually murdered in 1137. His nephew, Eric III, succeeded him, but he struggled with insurrections, notably facing a rebellion led by Olaf Haraldsen in 1139. Although Olaf briefly held power, Eric III defeated him by 1143 and ruled peacefully until his abdication in 1146.
The next succession crisis began with Eric III's abdication, as Sweyn III was elected king on Zealand while Canute V was elected in Skåneland. The ensuing conflict saw Sweyn and Canute clash repeatedly, pausing only to participate unsuccessfully in the Wendish Crusade. Sweyn, with the help of his cousin Valdemar I, continued to repel Canute’s advances, eventually establishing himself as the sole ruler by 1153.
Valdemar switched alliances in 1153 and helped Canute V expel Sweyn. After Sweyn returned with German reinforcements in 1156, peace negotiations led to an agreement dividing Denmark into three kingdoms. However, the peace was short-lived. Sweyn orchestrated the murder of Canute at a feast in 1157, an event known as the "Blood Feast of Roskilde." Valdemar survived the attack and gathered Canute's followers, ultimately defeating Sweyn at the Battle of Grathe Heath, where Sweyn was killed, possibly by a peasant while fleeing. This victory secured Valdemar's position as the undisputed king of Denmark, bringing an end to the prolonged period of civil strife.