information:extraction, stylistic:tone, structural:scholar_edition
Kingdom of Bavaria

When the Holy Roman Empire dissolved under Napoleon 's onslaught, Bavaria became a kingdom in 1806 and joined the Confederation of the Rhine.

The Duchy of Jülich was ceded to France and the Electoral Palatinate was divided between France and the Grand Duchy of Baden. The Duchy of Berg was given to Joachim Murat. The County of Tyrol and the federal state of Salzburg were temporarily annexed with Bavaria but eventually ceded to Austria at the Congress of Vienna. In return, Bavaria was allowed to annex the modern-day region of Palatinate to the west of the Rhine and Franconia in 1815.

Between 1799 and 1817, the leading minister, Count Montgelas, followed a strict policy of modernization copying Napoleonic France; he laid the foundations of centralized administrative structures that survived the monarchy and, in part, have retained core validity through to the 21st century. In May 1808, a first constitution was passed by Maximilian I, being modernized in 1818. This second version established a bicameral Parliament with a House of Lords (Kammer der Reichsräte) and a House of Commons (Kammer der Abgeordneten). That constitution was followed until the collapse of the monarchy at the end of World War I.

After the rise of Prussia in the early 18th century, Bavaria preserved its independence by playing off the rivalry of Prussia and Austria. Allied to Austria, it was defeated along with Austria in the 1866 Austro-Prussian War and was not incorporated into the North German Confederation of 1867, but the question of German unity was still alive. When France declared war on Prussia in 1870, all the south German states (Baden, Württemberg, Hessen-Darmstadt and Bavaria) aside from Austria, joined the Prussian forces and ultimately joined the Federation, which was renamed Deutsches Reich (German Empire) in 1871.

Bavaria continued as a monarchy, and retained some special rights within the federation (such as railways and postal services and control of its army in peace times).