The duchy of Upper Bavaria was created for the first time with the "First Bavarian partition" in 1255 under duke Louis II but there was no exact correlation between this duchy and the current territory. After the reunification in 1340 Bavaria was divided again in 1349, and in 1392 the duchies Bavaria-Munich and Bavaria-Ingolstadt were created in Upper Bavaria. In 1505 Bavaria was permanently reunited. For administrative purposes, Bavaria was split into "Rentämter" (plural of ""). Upper Bavaria consisted of the Rentamt Munich and Rentamt Burghausen.