Ludwig II was King of Bavaria from 1864 until his death in 1886. He is sometimes called the Swan King or der Märchenkönig. He also held the titles of Count Palatine of the Rhine, Duke of Bavaria, Duke of Franconia, and Duke in Swabia.
Ludwig succeeded to the throne in 1864. He was aged 18. Two years later, Bavaria and Austria fought a war against Prussia lasting only a matter of weeks, which they lost. However, in the Franco-Prussian War of 1870, Bavaria sided with Prussia against France, and after the Prussian victory, it became part of the new German Empire, comprising 22 monarchies, led by the Prussian Monarchy, whose king became Deutscher Kaiser. The two candidates for the new Kaiser were Ludwig and his cousin Wilhelm. Bavaria did however retain a large degree of autonomy on some matters within the Empire, which was named the Reich. In the new Imperial Constitution, Bavaria was able to secure for itself extensive rights, in particular regarding military sovereignty.