Flag of Buda before 1873.
Historical coat of arms of Buda, used between 1703-1873.
The Buda fortress and palace were built by King Béla IV of Hungary 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.
While Pest was mostly Hungarian in the 15th century, Buda had a German majority; however according to the Hungarian Royal Treasury, it had a Hungarian majority with a sizeable German minority in 1495. Buda became part of Ottoman-ruled central Hungary from 1541 to 1686. It was the capital of the province of Budin during the Ottoman era. By the middle of the seventeenth century Buda had become majority Muslim, largely resulting from an influx of Balkan Muslims.
In 1686, two years after the unsuccessful siege of Buda, a renewed European campaign was started to enter Buda, which was formerly the capital of medieval Hungary. This time, the Holy League's army was twice as large, containing over 74,000 men, including German, Dutch, Hungarian, English, Spanish, Czech, French, Croat, Burgundian, Danish and Swedish soldiers, along with other Europeans as volunteers, artillerymen, and officers, the Christian forces reconquered Buda (see Siege of Buda).
After the reconquest of Buda, bourgeoisie from different parts of southern Germany moved into the almost deserted city. Germans — also clinging to their language — partly crowded out, partly assimilated the Hungarians and Serbians they had found here. As the rural population moved into Buda, in the 19th century slowly Hungarians became the majority there.