The Electorate of Hesse (Kurfürstentum Hessen), also known as Hesse-Kassel or Kurhessen, was a landgraviate whose prince was given the right to elect the Emperor by Napoleon. When the Holy Roman Empire was abolished in 1806, its prince, William I, chose to retain the title of Elector, even though there was no longer an Emperor to elect. In 1807, with the Treaties of Tilsit, the area was annexed to the Kingdom of Westphalia, but in 1814, the Congress of Vienna restored the electorate. The state was the only electorate within the German Confederation. It consisted of several detached territories to the north of Frankfurt, which survived until the state was annexed by Prussia in 1866 following the Austro-Prussian War. The Elector's formal titles included "Elector of Hesse, Prince of Fulda (Fürst von Fulda), Prince of Hersfeld, Hanau, Fritzlar and Isenburg, Count of Katzenelnbogen, Dietz, Ziegenhain, Nidda, and Schaumburg." The Landgraviate of Hesse-Kassel originated in 1567 with the division of the Landgraviate of Hesse between the heirs of Philip I of Hesse ("the Magnanimous") after his death. Philip's eldest son, William IV, received Hesse-Kassel, which comprised about half the area of the Landgraviate of Hesse, including the capital, Kassel. William's brothers received Hesse-Marburg and Hesse-Rheinfels, but their lines died out within a generation, and the territories then reverted to Hesse-Kassel and to the Landgraviate of Hesse-Darmstadt. The reign of the Landgrave William IX was an important epoch in the history of Hesse-Kassel. Ascending the throne in 1785, he took part in the War of the First Coalition against French First Republic a few years later, but in 1795 the Peace of Basel was signed. In 1801 he lost his possessions on the left bank of the Rhine, but in 1803 he was compensated for these losses with some former French territory around Mainz, and at the same time he was raised to the dignity of Prince-elector (Kurfürst) William I, a title he retained even after the dissolution of the Holy Roman Empire.