Vienna's history as showpiece imperial capital is a comparatively brief one. From having been a not very important Roman fort called Vindobona on the military border of the River Danube, Vienna had to wait until the rise of the Babenberg dynasty before it became a capital of any sort. In 1156, under Heinrich II Jasomirgott (1141-72), the Babenbergs' margravate was elevated to a duchy, with the ducal palace situated somewhere near Am Hof in Vienna. When the Babenberg male line came to an end in 1246, a long-running dispute broke out over who should rule over the region. In the end, it was a little-known count, Rudolf of Habsburg , who proved victorious, much to the annoyance of the Viennese, who had backed the loser, King Otakar II of Bohemia. Although the Habsburgs were to rule over the city for the next 640 years, Vienna only sporadically served as the dynastic capital. Rudolf IV (1356-65) was one of the few to treat it as such, and was given the nickname "The Founder" after he established the city's university and laid the foundation stone of the future cathedral during the course of his short reign.
The main stumbling block to Vienna's development was the threat posed by the Turks, who besieged the city twice. Although it is the later siege of 1683 that has captured the imagination of historians, the 1529 Turkish siege was a much closer-run thing. The Ottoman empire was at the zenith of its power, and Vienna was defended by only a small garrison under Count Salm. Having shelled the city and killed some 1500 of its citizens, the Turks suddenly withdrew - quite why, no one knows. During the 1683 siege , the city garrison of 10,000 men faced an Ottoman army of over 200,000. That the city was saved was no thanks to its emperor, Leopold I (1658-1701), who fled for the safety of Upper Austria. This time the Turks' defeat was assured by a combination of the sultan's greed - he tried to force the city to surrender by besieging it for over two months, rather than storming it and sharing the booty with his soldiers - and the arrival of a relief force under Polish King Jan Sobieski.
It was only after the Turks had been beaten back from the gates of Vienna a second time that the city finally established itself as the Habsburgs' permanent Residenzstadt , or Kaiserstadt . Over the next hundred years, an outpouring of Baroque art and architecture transformed the city, which could now safely spread out beyond the walls of the Innere Stadt. During the Napoleonic era, Vienna was besieged twice more in short succession by the French - in 1805, and again in 1809. Emperor Franz I (1792-1835) followed tradition by fleeing to safety, but this time the city surrendered on both occasions, and had to suffer the ignominy of occupation by French troops. In 1815, with Napoleon almost defeated, the city regained some of its pride as the setting for the great Congress of Vienna , at which the new European balance of power was thrashed out, amidst a great deal of dancing and feasting.
In March 1848, revolution broke out on the streets of the capital, and wasn't extinguished until imperial troops brutally suppressed the uprising in October. The upshot of it all was the accession of the 18-year-old Emperor Franz-Josef I (1848-1916), whose immensely long reign encompassed the city's golden age. The old walls were torn down and the great edifices of the Ringstrasse built: the court museums, parliament, the university, to name but a few. The city's population swelled to over two million, some ten percent of whom were Jewish immigrants, giving Vienna the largest Jewish community in the German-speaking world. At the same time, anti-Semitism as a viable modern political force was invented here, in front of the young Hitler's very eyes, in the first decade of the twentieth century.
In the 1920s and early 1930s, Vienna became renowned for its enlightened municipal socialism, during a period that has since gone down in history as Rotes Wien , or Red Vienna . However, for much of the century the city, rather like Berlin, had the misfortune of serving as a weather vane of European history. The political battles between Left and Right fought out on the streets of Vienna mirrored those in Berlin, and the weekend Hitler enjoyed his greatest electoral victory in the Reichstag, Austro-fascism was declared in Vienna. In 1938, Vienna was the first foreign capital to fall "victim" to the Nazis, greeting the Führer with delirious enthusiasm, and sounding the death knell on the city's 200,000 Jews. For a decade after the war, Vienna, like Berlin, was under Allied occupation , divided into French, American, British and Soviet sectors, with the Innere Stadt as an international zone, in which the Allies patrolled the streets together "four in a jeep", as the period became known.
Since the withdrawal of the four Allied powers in 1955, Vienna has lived a fairly peaceful existence, best known as one of the three cities that serve as UN headquarters and as host to international conferences. However, the opening up of Eastern Europe and the break-up of Yugoslavia have had a profound effect on the city, with an estimated ten percent of the population now made up of recently arrived immigrants. Although most Viennese can trace their ancestry back to the far corners of the old empire, many locals are fearful of the newcomers. The impact on voting patterns has been marked, with 1996 proving something of a watershed: the Socialists lost overall control of the city council for the first time in its democratic history, while the far right Freedom Party (FPÖ) gained a staggering 27 percent of the vote, becoming the main opposition in the city council