After the death of his elder brother Duke Valdemar III in 1257, Eric inherited the claim to the Duchy of Schleswig. However, his uncle and potential feudal overlord King Christopher I of Denmark refused to install him as duke.
After the death of Christopher in 1259, he was created Duke of Schleswig by the new king Eric V in 1260.
Already the following year, fighting with the king broke out anew. The Queen Dowager, Margaret Sambiria, acting as regent for her under age son, feared aggression from the Duke. However, Duke Eric was able to defeat the royal army at the Battle of Lohede and capture the young King Eric and his mother. As a result, he was able to obtain huge advantages for his duchy at the subsequent treaty in 1264.