In 1805 under the Peace of Pressburg between the Napoleonic France and the Holy Roman Empire several duchies were elevated to kingdoms. The Wittelsbach rulers of Bavaria held the title "King of Bavaria" from 1806 until 1918. The prince-elector of Bavaria, Maximilian IV Joseph formally assumed the title King Maximilian I of Bavaria on 1 January 1806. The well-known so called "Märchenkönig" (Fairy tale king) Ludwig II constructed Neuschwanstein Castle, Herrenchiemsee, and Linderhof Palace during his reign (1864–1886), threatening not only to go bankrupt in person, but also to bankrupt the country in the process. In 1918 Ludwig III lost his throne in the German Revolution of 1918–1919.