In 1799, Duke of Zweibrücken Maximilian IV inherited besides the land that he already held the long united lands of the Electorate of Bavaria and the Electorate of the Palatinate. While these three countries were now "de jure" in personal union, this did not shift the power structures on the ground at all, for Palatinate-Zweibrücken had already been occupied by French Revolutionary troops. Because of the terms of the Congress of Vienna (1815), the part of Palatinate-Zweibrücken lying north of the Glan, and thus Meisenheim too, were assigned not to the Kingdom of Bavaria but rather to the Landgraviate of Hesse-Homburg. From 1816 onwards, Meisenheim was the administrative seat of the "Oberamt" of Meisenheim and an "Oberschultheißerei". In 1866, the Grand Duchy of Hesse inherited the whole territory, but after losing a war later that same year, the grand duchy had to cede Hesse-Homburg to the Kingdom of Prussia. The town of Meisenheim itself was not wholly reunited until after the Second World War when state of Rhineland-Palatinate was founded. Until then, the lands just across the Glan had been Bavarian (either as foreign territory or as another province within Imperial, Weimar or Nazi Germany) since the Congress of Vienna.