Ludwig II (Ludwig Otto Friedrich Wilhelm; English: Louis Otto Frederick William) (25 August 1845 – 13 June 1886) was King of Bavaria from 1864 until his death in 1886. He is sometimes called the Swan King (English) and der Märchenkönig, the Fairy Tale King (German). He also held the titles of Count Palatine of the Rhine, Duke of Bavaria, Duke of Franconia, and Duke in Swabia.
He succeeded to the throne aged 18. Two years later Bavaria and Austria fought a war against Prussia, which they lost. However, in the Franco-Prussian War of 1870 they sided with Prussia against France, and after it Bavaria became part of the new German Empire led by Prussia. Ludwig remained King of Bavaria but withdrew from many state affairs remaining within the powers of Bavaria, in favor of extravagant artistic and architectural projects. He commissioned the construction of two lavish palaces and the Neuschwanstein Castle and was a devoted patron of the composer Richard Wagner. Ludwig spent all his royal revenues (although not state funds) on these projects, borrowed extensively, and defied all attempts by his ministers to restrain him. This extravagance was used against him to declare him insane, an accusation which has since been claimed to have been incorrect. Today, his architectural and artistic legacy includes many of Bavaria's most important tourist attractions.