Treaty of Teschen The Treaty of Teschen ( , i . e . , " Peace of Teschen " ) was signed on May 13 , 1779 , in Cieszyn ( " Teschen " ) , Austrian Silesia , between Austria and Prussia , which officially ended the War of the Bavarian Succession sparked by the death of Elector Maximilian III Joseph . Holy Roman Emperor , Joseph II of Austria , sought to acquire most of Bavaria and the Upper Palatinate upon the death of Maximilian III , whose sister , Maria Josepha , was his wife until her death in 1767 . The direct heir was Charles IV Theodore and he was amenable to an agreement with Joseph II that would allow him to acquire parts of the Austrian Netherlands in exchange . However , Charles Theodore had no legitimate heirs so his successor was his cousin , Charles II August , Duke of Zweibrücken . Charles August objected to the agreement depriving him of the Bavarian inheritance and appealed to the Reichstag in Regensburg . His cause was taken up by Prussia , which feared any increase in Austrian territory , and by Saxony , whose Wettin royal house was married into the Wittelsbach family and therefore had allodial claims to parts of the inheritance . The War of the Bavarian Succession broke out after Austria and Prussia could not negotiate their differences . The war was a stalemate as the Prussians were not able to advance far into Bohemia or Austria , but the Austrians were unwilling to invade Saxony or Prussia . This was partly because Maria Theresa , the mother of Joseph II and his co - ruler as Queen of Bohemia and Archduchess of Austria was firmly against the war after it became clear that a stalemate prevailed . She dispatched peace initiatives to Frederick II of Prussia and forced Joseph II to accept mediation by France and Russia . The peace came at the initiative of Empress Catherine II of Russia and was guaranteed by both Russia and France . The accord dictated that the Archduchy of Austria ( Principality of Austria above the Enns ) would receive the Bavarian lands east of the Inn river in compensation , a region then called " Innviertel " , stretching from the Bishopric of Passau to the northern border of the Archbishopric of Salzburg . However , one of the requirements was that Austria would recognize the Prussian claims to the Franconian margraviates of Ansbach and Bayreuth , ruled in personal union by Margrave Christian Alexander from the House of Hohenzollern . Prussia finally purchased both margraviates in 1791 . The Electorate of Saxony received a sum of six million guilders ( florins ) from Bavaria in exchange of its inheritance claims . With the accession of Elector Charles Theodore , the electorates of Bavaria and the County Palatine of the Rhine ( i . e . the territories in the Rhenish Palatinate and the Upper Palatinate ) were under the united rule of the House of Wittelsbach . Their electoral votes were combined into one per a provision in the earlier Treaty of Westphalia in 1648 , thereby reducing the number of electorates in the Holy Roman Empire to eight . The Innviertel , except for a short time during the Napoleonic Wars , has remained with Upper Austria up to today . In 1785 Maria Theresa ' s son and successor Emperor Joseph II of Austria made another try at attaching the Bavarian lands to his Habsburg possessions , and even contracted with Elector Charles Theodore to swap it for the Austrian Netherlands . However , Joseph II again did not agree to a full exchange of all provinces within the Austrian Netherlands and the agreement collapsed amidst tacit French opposition and overt Prussian hostility . These plans were however once again frustrated by King Frederick II of Prussia , who raised the opposition by the " Fürstenbund " , an association of several Imperial princes . After the War of the Austrian Succession and the Seven Years ' War , the Austrian House of Habsburg was no longer able to exercise its Imperial power against Prussian resistance .