The Electorate of Bavaria consisted of most of the modern regions of Upper Bavaria, Lower Bavaria, and the Upper Palatinate. Before 1779, it also included the Innviertel, now part of modern Austria. This was ceded to the Habsburgs by the Treaty of Teschen, which ended the War of the Bavarian Succession. There were a considerable number of independent enclaves and jurisdictions within those broad areas, however, including the principalities of Palatinate-Neuburg and Palatinate-Sulzbach in the Upper Palatinate, which were held by cadet branches of the Palatinate line of the Wittelsbachs; the ecclesiastical states of Freising, Regensburg, and Passau, and the imperial free city of Regensburg. For administration purposes Bavaria was already from 1507 divided into four stewardships (
Rentamt): Munich, Burghausen, Landshut and Straubing. With the acquisition of the Upper Palatinate during the Thirty Years' War the stewardship Amberg was added. In 1802 they were abolished by the minister Maximilian von Montgelas. In 1805 shortly before the elevation Tirol and Vorarlberg were united with Bavaria, same as several of these enclaves.