The history of Budapest consists of the separate history of the two sister towns, Buda and Pest. The Romans founded, in the 2nd century A.D., on the right bank of the Danube, on the site of the actual ó-Buda, a colony, on the place of a former Celtic settlement. This colony was named Aquincum, a transformation from the former Celtic name of Ak-ink, meaning "rich waters." The Roman occupation lasted till A.D. 376, and then the place was invaded by Huns, Ostrogoths, and later by Avars and Slavs. When the Magyars came into the country, at the end of the 10th century, they preserved the names of Buda and Pest, which they found for these two places. The origin of Pest proper is obscure, but the name, apparently derived from the old Slavonic pestj, a stove (like Ofen, the German name of Buda), seems to point to an early Slavonic settlement. The Romans never gained a foothold on this side of the river.
When it first appears in history Pest was essentially a German settlement, and a chronicler of the 13th century describes it as "Villa Teutonica ditissima." Christianity was introduced early in the 11th century. In 1241 Pest was destroyed by the Tatars, after whose departure in 1244 it was created a royal free city by Bela IV., and repeopled with colonists of various nationalities. The succeeding period seems to have been one of considerable prosperity, though Pest was completely eclipsed by the sister town of Buda with its fortress and palace. This fortress and palace were built by King Bela IV. in 1247, and were the nucleus round which the town of Buda was built, which soon gained great importance, and became in 1361 the capital of Hungary. In 1526 Pest was taken and pillaged by the Turks, and from 1541 to 1686 Buda was the seat of a Turkish pasha. Pest in the meantime entirely lost its importance, and on the departure of the Turks was left little more than a heap of ruins. Its favourable situation and the renewal of former privileges helped it to revive, and in 1723 it became the seat of the highest Hungarian officials.
Maria Theresa and Joseph II. did much to increase its importance, but the rapid growth which enabled it completely to outstrip Buda belongs entirely to the 19th century. A signal proof of its vitality was given in 1838 by the speed and ease with which it recovered from a disastrous inundation that destroyed 3000 houses. In 1848 Pest became the seat of the revolutionary diet, but in the following year the insurgents had to retire before the Austrians under Windischgrätz. A little later the Austrians had to retire in their turn, leaving a garrison in the fortress of Buda, and, while the Hungarians endeavoured to capture this position, General Hentzi retaliated by bombarding Pest, doing great damage to the town. In 1872 both towns were united into one municipality. In 1896 took place here the millennium exhibition, in celebration of the thousandth anniversary of the foundation of the kingdom of Hungary.
The official publications of the Budapest Communal Bureau of Statistics have acquired a European repute for their completeness, and their fearless exposure of shortcomings has been an element in the progress of the town. Reference should also be made to separate works of the director of that institution, Dr Joseph de Körösy, known in England for his discovery of the law of marital fertility, published by the Royal Society, and by his labours in the development of comparative international statistics. His Statistique Internationale des grandes villes and Bulletin annuel des finances des grandes villes give valuable comparative data. See also Die österreichisch-Ungarische Monarchie in Wort und Bild (Wien, 1886-1902, 24 vols.); volume xii., published in 1893, is devoted to Budapest.