The counts palatine of the Rhine held the office of imperial vicars in the territories under Frankish law (in Franconia, Swabia and the Rhineland) and ranked among the most significant secular Princes of the Holy Roman Empire. In 1541 elector Otto Henry converted to Lutheranism. Their climax and decline is marked by the rule of Elector Palatine Frederick V, whose coronation as king of Bohemia in 1619 sparked the Thirty Years' War. After the 1648 Peace of Westphalia, the ravaged lands were further afflicted by the "Reunion" campaigns launched by King Louis XIV of France, culminating in the Nine Years' War (1688–97). Ruled in personal union with the Electorate of Bavaria from 1777, the Palatinate was finally disestablished with the German mediatization and annexation by Baden on 27 April 1803.