Palatinate-Birkenfeld-Gelnhausen was a state of the Holy Roman Empire seated in Gelnhausen in the south of modern Hesse, Germany. Palatinate-Birkenfeld-Gelnhausen was partitioned from Palatinate-Birkenfeld-Bischweiler in 1654. It was a mediate state with few rights. In 1799 the Counts Palatine were granted the title "Duke in Bavaria" by their distant relations, the Duke of Bavaria, which, in 1806, became the first King of Bavaria. These two lines are the only branches of the House of Wittelsbach which did not eventually become extinct. House of Wittelsbach Counties of the Holy Roman Empire