However, already in 1149 it served as a residence of the Sponheim duke Heinrich V of Carinthia, where he received King Konrad III of Germany on his way back from the Second Crusade. He was succeeded by his brother Duke Hermann II of Carinthia, who became "Vogt" protector of the church in 1176 and subsequently the Sponheimer made the estates of Sankt Veit their permanent residence and capital of the Carinthian duchy, which it remained until 1518. Herman's son Bernhard von Spanheim (d. 1256) had the ducal castle and fortifications built, and granted Sankt Veit town privileges 1224. Here he held a glamorous court and received minnesingers like Walther von der Vogelweide, who stayed here in 1214, and Ulrich von Liechtenstein. Sankt Veit also may have been the domicile of Heinrich von dem Türlin where he wrote his Middle High German "Diu Crône" poem.