<P> There are several theories about Pest . One states that the name derives from Roman times, since there was a local fortress (Contra - Aquincum) called by Ptolemaios "Pession" ("Πέσσιον", iii. 7. § 2). Another has it that Pest originates in the Slavic word for cave, пещера, or peștera . A third cites пещ, or peșt, referencing a cave where fires burned or a limekiln . </P> <P> The first settlement on the territory of Budapest was built by Celts before 1 AD . It was later occupied by the Romans . The Roman settlement--Aquincum--became the main city of Pannonia Inferior in 106 AD . At first it was a military settlement, and gradually the city rose around it, making it the focal point of the city's commercial life . Today this area corresponds to the Óbuda district within Budapest . The Romans constructed roads, amphitheaters, baths and houses with heated floors in this fortified military camp . The Roman city of Aquincum is the best - conserved of the Roman sites in Hungary . The archaeological site was turned into a museum with inside and open - air sections . </P> <P> The Magyar tribes led by Árpád, forced out of their original homeland north of Bulgaria by Tsar Simeon after the Battle of Southern Buh, settled in the territory at the end of the 9th century displacing the founding Bulgarian settlers of the towns of Buda and Pest, and a century later officially founded the Kingdom of Hungary . Research places the probable residence of the Árpáds as an early place of central power near what became Budapest . The Tatar invasion in the 13th century quickly proved that it is difficult to mount a defence on a plain . King Béla IV of Hungary therefore ordered the construction of reinforced stone walls around the towns and set his own royal palace on the top of the protecting hills of Buda . In 1361 it became the capital of Hungary . </P> <P> The cultural role of Buda was particularly significant during the reign of King Matthias Corvinus . The Italian Renaissance had a great influence on the city . His library, the Bibliotheca Corviniana, was Europe's greatest collection of historical chronicles and philosophic and scientific works in the 15th century, and second only in size to the Vatican Library . After the foundation of the first Hungarian university in Pécs in 1367 (University of Pécs), the second one was established in Óbuda in 1395 (University of Óbuda). The first Hungarian book was printed in Buda in 1473 . Buda had about 5,000 inhabitants around 1500 . </P>

When did budapest became the capital of hungary