Though he could later reconcile with the Emperor, the border conflict with Hungary culminated in several clashes of arms after 1242, after King Béla IV of Hungary marched into Austria to reconquer occupied lands. Duke Frederick was killed at the 1246 Battle of the Leitha River, whereby the Babenberg line became extinct in the male line. According to feudal law, the immediate heritable fees fell back to the suzerain, the Holy Roman Emperor. However, Emperor Frederick II, in the last years of his rule, was weakened by the struggle against Pope Innocent IV, and was stuck in the Italian Wars between the Guelphs and Ghibellines. His death in 1250 and the death of his only surviving son King Conrad IV four years later ended the line of Hohenstaufen rulers, only eight years after the extinction of the Babenberg dynasty. The extinction led to the Great Interregnum, a period of several decades during which the status of the country's rulers was disputed. While in the following years several candidates were elected King of the Romans, none of them were able to control the Empire. It was the ambitious Přemyslid ruler Ottokar II of Bohemia, son of King Wenceslaus I, who took the occasion to take over the rule in the "princeless" lands of late Duke Frederick II the Warlike. Referring to the "Privilegium Minus", Pope Innocent IV, against the feudal principle of patrilineal inheritance, confirmed the hereditary rights of Frederick's sister Margaret, widow of Henry of Hohenstaufen, and his niece Gertrude, widow of Ottokar's elder brother Přemyslid Margrave Vladislaus of Moravia who died in 1247. Upon the death of Gertrude's second husband, Margrave Herman VI of Baden, in 1250, Ottokar invaded the Austrian lands, acclaimed by the local nobility. To substantiate his claims, he married Margaret (about 30 years his senior) in 1252. King Béla IV of Hungary contested this, referring to the Gertrude's third marriage with his relative Roman Danylovich and occupied the Styrian lands. However, Ottokar prevailed as he defeated the Hungarian troops at the Battle of Kressenbrunn. Bohemian king since 1253, he now was sole ruler of the Bohemian, Moravian, Austrian and Styrian lands—an anticipation of the early modern Habsburg Monarchy after 1526.