Though Budapest has formally existed only since 1873 - when the twin cities of Buda and Pest were united in a single municipality, together with the smaller Óbuda - the history of settlement here goes back as far as the second millennium BC. During the first Age of Migrations, the area was settled by waves of peoples, notably Scythians from the Caucasus and Celts from what is now France.
During the first century BC, the Celtic Eravisci tribe was absorbed into Pannonia, a vast province of the Roman Empire. This was subsequently divided into two regions, one of which, Pannonia Inferior, was governed from the garrison town of Aquincum on the west bank of the Danube; ruins of a camp, villas, baths and an amphitheatre can still be seen today.
The Romans withdrew in the fifth century AD to be succeeded by the Huns. Germanic tribes, Lombards, Avars and Slavs all followed each other during the second Age of Migrations, until the arrival of the Magyars in about 896. According to the medieval chronicler, Anonymous, while other tribes spread out across the Carpathian basin, the clan of Árpád settled on Csepel sziget (Csepel Island), and it was Árpád's brother, Buda, who purportedly gave his name to the west bank of the new settlement. It was under the Árpád dynasty that Hungary became a Christian state, ruled first from Esztergom and later from Székesfehérvár.
The development of Buda and Pest did not begin in earnest until the twelfth century, and was largely thanks to French, Walloon and German settlers who worked and traded here under royal protection. Both towns were devastated by the Mongols in 1241 and subsequently rebuilt by colonists from Germany, who named Buda " Ofen ", after its numerous lime-kilns. (The name Pest, which is of Slav origin, also means "oven".) During the fourteenth century, the Angevin kings from France established Buda as a royal seat , building a succession of palaces on the Várhegy. It reached its apogee in Renaissance times under the reign of "Good King" Mátyás (1458-90) and his Italian-born wife, Queen Beatrice, with a golden age of prosperity and a flourishing of the arts.
Hungary's catastrophic defeat at Mohács in 1526 paved the way for the Turkish occupation of Buda and Pest, which lasted 160 years until a pan-European army besieged Buda Castle for six weeks, finally recapturing it at the twelfth attempt. Under Habsburg rule , with control exerted from Vienna or Bratislava, recovery was followed by a period of intensive growth during the second half of the eighteenth century. In the first decades of the following century, Pest became the centre of the Reform movement led by Count Széchenyi, whose vision of progress was embodied in the construction of the Lánchíd (Chain Bridge), the first permanent link between Buda and Pest, which had hitherto relied on pontoon bridges or barges.
When the Habsburg empire was shaken by revolutions which broke out across Europe in March 1848 , local reformists and radicals seized the moment. While Lajos Kossuth (1802-94) dominated parliament, Sándor Petofi (1823-49) and his fellow revolutionaries plotted the downfall of the Habsburgs in the Café Pilvax (which exists today in a sanitized restaurant form in central Pest), from where they mobilized crowds on the streets of Pest. After the War of Independence ended in defeat for the Hungarians, Habsburg repression was epitomized by the hilltop Citadella on Gellért-hegy, built to cow the citizenry with its guns.
Following the Compromise of 1867, which established the Dual Monarchy familiarly known to its subjects as the K & K (from the German for "Emperor and King"), the twin cities underwent rapid expansion and formally merged. Pest was extensively remodelled, acquiring the Nagykörút (Great Boulevard) and Andrássy út, the grand thoroughfare that runs from the Belváros to the Városliget (City Park). Hungary's millennial anniversary celebrations in 1896 brought a fresh rush of construction, and Hosök tere (Heroes' Square) and Vajdahunyad Castle at the far end of Andrássy út are just two examples of the monumental style that encapsulated the age. New suburbs were created to house the burgeoning population, which was by now predominantly Magyar, although there were still large German and Jewish communities. At the beginning of the twentieth century the cultural efflorescence in Budapest rivalled that of Vienna and its café society that of Paris - a belle époque doomed by World War I.
In the aftermath of defeat, Budapest experienced the Soviet-ruled Republic of Councils under Béla Kun, and occupation by the Romanian army. The status quo ante was restored by Admiral Horthy , self-appointed regent for the exiled Karl IV - the "Admiral without a fleet, for the king without a kingdom" - whose regency was characterized by gala balls and hunger marches, bombastic nationalism and anti-Semitism. Yet Horthy was a moderate compared to the Arrow Cross Fascists, whose power grew as World War II raged.
Anticipating Horthy's defection from the Axis in 1944, Nazi Germany staged a coup, installing an Arrow Cross government, which enabled them to begin the massacre of the Jews of Budapest; they also blew up the Danube bridges as a way of hampering the advance of the Red Army. The six-month-long siege of Budapest reduced the Vár (Castle District) to rubble and severely damaged much of the rest of the city, making reconstruction the first priority for the postwar coalition government.
As the Communists gained ascendancy, the former Arrow Cross torture chambers filled up once again. A huge statue of the Soviet dictator (whose name was bestowed upon Budapest's premier boulevard) symbolized the reign of terror carried out by Mátyás Rákosi , Hungary's "Little Stalin". However, his liberally inclined successor, Imre Nagy , gave hope to the people, who refused to tolerate a comeback by the hardliners in 1956. In Budapest, peaceful protests turned into a city-wide uprising literally overnight: men, women and children defying Soviet tanks on the streets.
After Soviet power had been bloodily restored, János Kádár - initially reviled as a quisling - gradually normalized conditions, embarking on cautious reforms to create a " goulash socialism " that made Hungary the envy of its Warsaw Pact neighbours and the West's favourite Communist state during the late 1970s. A decade later, the regime saw the writing on the wall and anticipated Gorbachev by promising free elections , hoping to reap public gratitude. Instead - as Communism was toppled in Berlin and Prague - the party was simply voted out of power in Hungary. It was such an orderly transition from one system to another, yet so pregnant with consequences, that Hungarians simply refer to all that's happened since then as " the Changes ".
While governments have come and gone since the historic 1990 elections, Budapest's administration has remained in the hands of Gábor Demszky , who is running for a fourth consecutive term as mayor in 2002 - and will probably win, as voters reckon he's doing well, and aren't fazed by the hostility between Demszky and prime minister Viktor Orbán (allegedly dating back to their student days at ELTE), which scuppered the mayor's National Theatre project a few years ago.