The Kingdom of Bavaria (; ; spelled Baiern until 1825) was a German state that succeeded the former Electorate of Bavaria in 1806 and continued to exist until 1918. With the unification of Germany into the German Empire in 1871, the kingdom became a federated state of the new empire and was second in size, power, and wealth only to the leading state, the Kingdom of Prussia.
The polity's foundation dates back to the ascension of Elector Maximilian IV Joseph of the House of Wittelsbach as King of Bavaria in 1806. The crown continued to be held by the Wittelsbachs until the kingdom came to an end in 1918. Most of the border of modern Germany's Free State of Bavaria were established after 1814 with the Treaty of Paris, in which the Kingdom of Bavaria ceded Tyrol and Vorarlberg to the Austrian Empire while receiving Aschaffenburg and Würzburg.
In 1918, Bavaria became a republic after the German Revolution, and the kingdom was thus succeeded by the current Free State of Bavaria.
History
Foundation and expansion under Maximilian I
On 30 December 1777, the Bavarian line of the Wittelsbachs became extinct, and the succession to the Electorate of Bavaria passed to Charles Theodore, the Elector Palatine. After a separation of four and a half centuries, the Electoral Palatinate, to which the duchies of Jülich and Berg had been added, was thus reunited with Bavaria. In 1793, the French Revolutionary Army overran the Palatinate; in 1795, the French, under Moreau, invaded Bavaria itself, advanced to Munich—where they were received with joy by the long-suppressed Liberals—and laid siege to Ingolstadt. Charles Theodore, who had done nothing to prevent the war or to resist the invasion, fled to Saxony, leaving a regency, the members of which signed a convention with Moreau, by which he granted an armistice in return for a heavy contribution (7 September 1796). Between the French and the Austrians, Bavaria was now in a bad situation. Before the death of Charles Theodore (16 February 1799), the Austrians had again occupied the country, in preparation for renewing the war with France.
Maximilian IV Joseph (of Palatinate-Birkenfeld-Zweibrücken), the new elector, succeeded to a difficult inheritance. Though his own sympathies, and those of his all-powerful minister, Maximilian von Montgelas, were, if anything, French rather than Austrian, the state of the Bavarian finances, and the fact that the Bavarian Army was scattered and disorganized, placed him helpless in the hands of Austria; on 2 December 1800, the Bavarian Army was involved in the Austrian defeat at Hohenlinden, and Moreau once more occupied Munich. By the Treaty of Lunéville (9 February 1801), Bavaria lost the Palatinate and the duchies of Zweibrücken and Jülich. In view of the scarcely disguised ambitions and intrigues of the Austrian court, Montgelas now believed that the interests of Bavaria lay in a frank alliance with the French Republic; he succeeded in overcoming the reluctance of Maximilian Joseph; and, on 24 August, a separate treaty of peace and alliance with France was signed at Paris.
The 1805 Peace of Pressburg allowed Maximilian to raise Bavaria to the status of a kingdom. Accordingly, Maximilian proclaimed himself king on 1 January 1806. The king still served as an elector until Bavaria seceded from the Holy Roman Empire on 1 August 1806, joining the Confederation of the Rhine. The Duchy of Berg was ceded to Napoleon only in 1806. The new kingdom faced challenges from the outset of its creation, relying on the support of Napoleonic France. The kingdom faced war with Austria in 1809 and from 1810 to 1814 lost territory to Württemberg and Italy. In 1808, all relics of serfdom were abolished. In the same year, Maximilian promulgated Bavaria's first written constitution. Over the next five years, it was amended numerous times in accordance with Paris' wishes.
During the French invasion of Russia in 1812 about 30,000 Bavarian soldiers were killed in action. With the Treaty of Ried of 8 October 1813 Bavaria left the Confederation of the Rhine and agreed to join the Sixth Coalition against Napoleon in exchange for a guarantee of her continued sovereign and independent status. On 14 October, Bavaria made a formal declaration of war against Napoleonic France. The treaty was passionately backed by Crown Prince Ludwig and by Marshal Karl Philipp von Wrede. With the Battle of Leipzig in October 1813 ended the German Campaign with the Coalition nations as the victors, in a complete failure for the French, although they achieved a minor victory when a Bavarian army attempted to block the retreat of the French Grande Armée at Hanau.