The Kingdom of Bavaria 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. [1]