is today Lower Austria at the expense of the retreating Magyars. Leopold was succeeded in 994 by his son Henry I, who continued his father's policy, was followed in 1018 by his brother Adalbert, whose marked loyalty to Emperor Henry II and his Salian successor Henry III was rewarded by many tokens of favour. Adalbert expanded the Austrian territory up to the present borders on the Leitha, March and Thaya rivers. He was succeeded in 1055 by his nephew, Ernest. Leopold II, margrave from 1075, quarrelled with Emperor Henry IV during the Investiture Controversy, when he supported the papal side of Bishop Altmann of Passau. Though Leopold had to cope with the invading troops of Duke Vratislaus II of Bohemia and was defeated at the 1082 Battle of Mailberg, the emperor was unable to oust him from his march or to prevent the succession of his son Leopold III in 1096. Between 1075 - 1095 the dynasty had its seat at Babenberg Castle of Gars am Kamp. Leopold III supported Henry V, the son of Emperor Henry IV, in his rising against his father, but was soon drawn over to the emperor's side. In 1106 he married the daughter of Henry IV, Agnes, widow of Duke Frederick I of Swabia. In 1125 he declined the royal crown in favour of Lothair of Supplinburg. His zeal in founding monasteries, such as Klosterneuburg Monastery, earned for him his surname "the Pious", and canonization by Pope Innocent VIII in 1485. He is regarded as the patron saint of Lower and Upper Austria. Dukes of Austria One of Leopold's younger sons was Bishop Otto of Freising. His eldest son Leopold IV became margrave in 1136, and in 1139 received the Duchy of Bavaria from the hands of King Conrad III, who had banned the Welf duke Henry the Proud. Leopold's brother Henry Jasomirgott (allegedly named after his favourite oath, "Yes, so [help] me God!") was made Count Palatine of the Rhine in 1140, and became Margrave of Austria on Leopold's death in 1141. Having married Gertrude, the widow of Henry the Proud, he was invested in 1143 with the Duchy of Bavaria, and resigned his office as count palatine. In 1147 he participated in the Second Crusade, and after his return, renounced Bavaria at the instance of the new king Frederick Barbarossa who gave the duchy of Bavaria to Henry the Proud's son, Duke