The title Duke in Bavaria () was accorded in 1799 for Wilhelm, Count Palatine of Zweibrücken-Birkenfeld-Gelnhausen and his descendants, who formed a cadet branch of the House of Wittelsbach, which had been the ruling house of Bavaria since 1180. The title Duke of Bavaria had been used for the rulers of Bavaria from 548 until Bavaria was elevated to the status of an Electorate of the Holy Roman Empire in 1623 (with some interruptions when Bavaria was subdivided; see Rulers of Bavaria).
On 16 February1799, the head of the House of Wittelsbach Elector Charles Theodor of Bavaria died. At the time there were two surviving branches of the Wittelsbach family: Zweibrücken (headed by Duke Maximilian Joseph) and Birkenfeld (headed by Count Palatine Wilhelm). Maximilian Joseph inherited Charles Thedore's title of Elector of Bavaria, while Wilhelm was compensated with the title of Duke in Bavaria. The form Duke in Bavaria was selected because in 1506 primogeniture had been established in the House of Wittelsbach resulting in there being only one Duke of Bavaria at any given time.
In 1965 there were only two male members of the family, Duke Ludwig Wilhelm and his cousin Duke Luitpold; both were elderly and had no children. On 18 March1965 Duke Ludwig Wilhelm adopted Prince Max of Bavaria, the second son of Albrecht, Duke of Bavaria and the grandson of Ludwig Wilhelm's sister Marie Gabrielle. From this point onwards Max has used the surname "Herzog in Bayern" in place of the surname "Prinz von Bayern". Max has five daughters all of whom were born with the surname "Herzogin in Bayern".
Ancestors
Wilhelm, the first Duke in Bavaria, was descended from the line of Palatinate-Zweibrücken-Birkenfeld-Gelnhausen. His ancestors were:
Johann Karl of Zweibrücken-Gelnhausen (1638 - 1704), second surviving son of Christian, m. Esther Marie von Witzleben. They were parents of several sons.
Johann of Zweibrücken-Gelnhausen (1698 - 1780), second son of Johann Karl, m. Sophie Charlotte of Wild, father of Wilhelm, Duke in Bavaria.
Dukes in Bavaria
The members of the family used the title Duke or Duchess in Bavaria, with the style of Royal Highness.
Wilhelm (1752-1837), m. 1780 Countess Palatine Maria Anna of Birkenfeld (1753-1824), and had issue:
Maria Elisabeth Amalie Franziska (1784-1849), m. 1808 Louis Alexandre Berthier, sovereign Prince of Neuchâtel (1753-1815), and had issue.
Pius August (1786-1837), m. 1807 Princess and Duchess Amalie of Arenberg (1789-1823), and had issue: