the inheritance centuries onwards. About 1182, Conrad moved his residence from Stahleck Castle near Bacharach up the Rhine River to Heidelberg. Upon Conrad's death in 1195, the Palatinate passed to the House of Welf through the (secret) marriage of his daughter Agnes with Henry of Brunswick. When Henry's son Henry the Younger died without heirs in 1214, the Hohenstaufen king Frederick II enfeoffed the Wittelsbach duke Louis I of Bavaria. The Bavarian House of Wittelsbach eventually held the Palatinate territories until 1918. During a later division of territory among the heirs of Duke Louis II, Duke of Upper Bavaria, in 1294, the elder branch of the Wittelsbachs came into possession of both the Rhenish Palatinate and the territories in the Bavarian Nordgau (Bavaria north of the Danube river) with the centre around the town of Amberg. As this region was politically connected to the Rhenish Palatinate, the name Upper Palatinate () became common from the early 16th century in contrast to the Lower Palatinate along the Rhine. With the Treaty of Pavia in 1329, the Wittelsbach emperor Louis IV, a son of Louis II, returned the Palatinate to his nephews Rudolf and Rupert. In the Golden Bull of 1356, the Palatinate was recognized as one of the secular electorates, and given the hereditary offices of archsteward (, ) of the Empire and imperial vicar () of Franconia, Swabia, the Rhine, and southern Germany. From that time forth, the Count Palatine of the Rhine was usually known as the Elector Palatine (, ). Due to the practice of dividing territories among different branches of the family, by the early 16th century junior lines of the Palatine Wittelsbachs came to rule in Simmern, Kaiserslautern, and Zweibrücken in the Lower Palatinate, and in Neuburg and Sulzbach in the Upper Palatinate. The Elector Palatine, now based in Heidelberg, adopted Lutheranism in the 1530s; when the senior branch of the family died out in 1559, the Electorate passed to Frederick III of Simmern, a staunch Calvinist, and the Palatinate became one of the major centers of Calvinism in Europe, supporting Calvinist rebellions in both the Netherlands and France. Thirty Years' War In 1619, the Protestant Frederick V, Elector Palatine accepted the throne of Bohemia from the Bohemian estates. This initiated the 1618–1648 Thirty Years' War, one of the most destructive conflicts in human history; it caused over eight million fatalities from military action, violence, famine