The Treaty of Pavia which divided the House of Wittelsbach into two branches, was signed in Pavia in 1329.
Under the accord, Emperor Louis IV granted during his stay in Italy the Electorate of the Palatinate including the Bavarian Upper Palatinate to his brother Duke Rudolph's descendants, Rudolph II, Rupert I and Rupert II. Louis himself kept Upper Bavaria and inherited also Lower Bavaria in 1340. Rudolph I this way became the ancestor of the older (Palatinate) line of the Wittelsbach dynasty, which returned to power also in Bavaria in 1777 after the extinction of the younger (Bavarian) line, the descendants of Louis IV. It had been agreed with the Treaty of Pavia that with the extinction of one of both branches the remaining branch would inherit their possessions. According to the treaty, the electoral rights should alternate but with the Golden Bull of 1356 only the Palatinate line was invested with the electoral dignity.