After the founding of the Kingdom of Bavaria following the dissolution of the Holy Roman Empire in 1805, the state was totally reorganized and, in 1808, divided into 15 administrative districts(German: Regierungsbezirke (singular Regierungsbezirk)), in Bavaria called Kreise (singular: Kreis). They were created in the fashion of the French departements, quite even in size and population, and named after their main rivers. In the following years, due to territorial changes (e. g. loss of Tyrol Italy and Austria, addition of the Palatinate), the number of districts was reduced to 8. One of these was the Unterdonaukreis (Lower Danube District). In 1837, King Ludwig I of Bavaria renamed the Kreise after historical territorial names and tribes. This also involved border changes or territorial swaps. Thus the Unterdonaukreis changed to Lower Bavaria. The district capital was moved from Passau to Landshut which was added from Isarkreis.