Ludwig II (Ludwig Otto Friedrich Wilhelm; German: [ˈluːtvɪç ˈɔto ˈfʁiː.dʁɪç ˈvɪlˌhɛlm]; 25 August 1845 – 13 June 1886), also called the Swan King or the Fairy Tale King (der Märchenkönig), was King of Bavaria from 1864 until his death in 1886. He also held the titles of Count Palatine of the Rhine, Duke of Bavaria, Duke of Franconia and Duke in Swabia. Outside Germany, he is at times called "the Mad King" or Mad King Ludwig.
Ludwig ascended to the throne in 1864 at the age of 18. He increasingly withdrew from day-to-day affairs of state in favour of extravagant artistic and architectural projects. He commissioned the construction of lavish palaces: Neuschwanstein Castle, Linderhof Palace, and Herrenchiemsee. He was also a devoted patron of the composer Richard Wagner. Ludwig spent all his own private royal revenues (although not state funds as is commonly thought) 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, a determination that is now questioned.