Originally a Celtic settlement, Vienna, then called Vindobona, became an important Roman military and commercial center; Emperor Marcus Aurelius resided there and died there (A.D. 180). After the Romans withdrew (late 4th cent.), it rapidly changed hands among the invaders who overran the region. The Magyars, who gained possession of Vienna early in the 10th cent., were driven out by Leopold I of Babenberg, the first margrave of the Ostmark (see Austria). Construction on Vienna's noted Cathedral of St. Stephen began c.1135.
Several decades later Henry Jasomirgott, first duke of Austria, transferred his residence to the town, made it capital of the duchy, and erected a castle, Am Hof. The town was fortified by Ottocar II of Bohemia, who conquered Austria in 1251. In 1282, Vienna became the official residence of the house of Hapsburg. The city was occupied (1485–90) by Matthias Corvinus of Hungary and was besieged by the Turks for the first time in 1529. In the critical second siege (1683) by the Turks under Kara Mustafa and their Hungarian allies under Thokoly, the city, heroically defended by Ernst von Starhemberg, was on the verge of starvation when it was saved by John III (John Sobieski) of Poland.
Early in the 18th cent. a new circle of fortifications was built around the city, and many magnificent buildings were erected. Bernhard Fischer von Erlach drew up new plans for the Hofburg (the imperial residence) and built the beautiful Karlskirche; Johann von Hildebrandt designed St. Peter's Church, the Belvedere (summer residence of Prince Eugene of Savoy), and the Kinsky Palace; together they planned the Schwarzenburg Palace and the winter residence of Prince Eugene. Empress Maria Theresa (reigned 1740–80) enlarged the old university, founded in 1365, and completed the royal summer palace of Schönbrunn, started by her father, Charles VI (1711–40). Joseph II (1765–90) opened the Prater, a large imperial garden, which now contains an amusement park, to the public. Haydn, Mozart, Beethoven, and Schubert lived in Vienna and gave it lasting glory.
In 1805 and 1809, Vienna was occupied by Napoleon. In the early 19th cent. Vienna was famous for the waltzes of Joseph Lanner and the Strauss family, and for the farces of Nestroy, the comedies of Raimund, and the tragic dramas of Grillparzer. During the revolutions of 1848, revolutionists in Vienna forced Metternich to resign, but they were eventually suppressed by Windischgrätz.
In the late 19th and early 20th cent., Vienna flourished again as a cultural and scientific center. Rokitansky, Wagner-Jauregg, and Billroth (to whom Brahms dedicated the string quartets Op. 51) worked at the General Hospital; at the same time Freud was developing his theory of psychoanalysis. Vienna attracted Brahms, Mahler, Richard Strauss, and Arnold Schoenberg and his disciples, who gave it a further period of musical greatness. Krauss, Werfel, Hofmannsthal, Schnitzler, and Wassermann dominated the literary scene.
Vienna suffered hardships during World War I. Amidst food shortages and revolution it became, at the end of the war, the capital of the small republic of Austria. In 1922, Vienna became an autonomous province ( Bundesland ) of Austria. The highly successful Social Democratic city government headed by Mayor Karl Seitz (1923–34) initiated a program of municipal improvements. In public housing Vienna set an example for the world. Model apartment houses for workers, notably the huge Karl Marx Hof, began to replace the city's slums. The projects were badly damaged in the civil war of Feb., 1934, between Viennese Socialists and the Austrian government of Chancellor Dollfuss.
On Mar. 15, 1938, Adolf Hitler triumphantly entered Vienna, and Austria was annexed to Germany. During World War II the city suffered considerable damage. The Jewish population (115,000 in 1938), residing mainly in the Leopoldstadt district (designated the official ghetto in the 17th cent.), was reduced through extermination or emigration to 6,000 by the end of the war. The Russian army entered Vienna in Apr., 1945. Vienna and Austria were divided into four occupation zones by the victorious Allies. The occupation lasted until 1955, when, by treaty, the four powers reunited Austria as a neutral state.
Vienna became the headquarters of the International Atomic Energy Agency in 1957; it is the headquarters for several other international organizations, including the Organization of Petroleum Exporting Countries. The city also has been a neutral site for international talks, such as those between President Kennedy and Premier Khrushchev in 1961.