Situated near a settlement (Munichen) that was established in Carolingian times, Munich was founded (1158) by Henry the Lion, duke of Saxony and of Bavaria. In 1255 it was chosen as the residence of the Wittelsbach family, the dukes of Bavaria; it later became (1506) the capital of the dukedom. During the Thirty Years War, Munich was occupied (1632) by Gustavus II of Sweden. In 1806 the city was made capital of the kingdom of Bavaria. Under the kings Louis I (1825–48), Maximilian II (1848–64), and Louis II (1864–86), Munich became a cultural and artistic center, and it played a leading role in the development of 19th- and 20th-century German painting.
After World War I the city was the scene of considerable political unrest. National Socialism (Nazism) was founded there, and on Nov. 8, 1923, Adolf Hitler failed in his attempted Munich "beer-hall putsch"—a coup aimed at the Bavarian government. Despite this fiasco, Hitler made Munich the headquarters of the Nazi party, which in 1933 took control of the German national government. Michael Cardinal Faulhaber, the archbishop of Munich, was one of the few outspoken critics of the National Socialist regime. In Sept., 1938, the Munich Pact was signed in the city; in 1939 Hitler suppressed a Bavarian separatist plot there. Munich was badly damaged during World War II, but after 1945 it was extensively rebuilt and many modern buildings were constructed.