year, alternating between those nationalities. This would not be the last such case. In 1465, King Matthias Corvinus founded the Hungarian Kingdom's third university, in Pressburg (Bratislava), but it was closed in 1490 after his death. Hussites also settled in the region after the Hussite Wars. Owing to the Ottoman Empire's expansion into Hungarian territory, Bratislava was designated the new capital of Hungary in 1536, ahead of the fall of the old Hungarian capital of Buda in 1541. It became part of the Austrian Habsburg monarchy, marking the beginning of a new era. The territory comprising modern Slovakia, then known as Upper Hungary, became the place of settlement for nearly two-thirds of the Magyar nobility fleeing the Turks and became far more linguistically and culturally Hungarian than it was before. Partly thanks to old Hussite families and Slovaks studying under Martin Luther, the region then experienced a growth in Protestantism. For a short period in the 17th century, most Slovaks were Lutherans. They defied the Catholic Habsburgs and sought protection from neighbouring Transylvania, a rival continuation of the Magyar state that practised religious tolerance and normally had Ottoman backing. Upper Hungary, modern Slovakia, became the site of frequent wars between Catholics in the west territory and Protestants in the east, as well as against Turks; the frontier was on a constant state of military alert and heavily fortified by castles and citadels often manned by Catholic German and Slovak troops on the Habsburg side. By 1648, Slovakia was not spared the Counter-Reformation, which brought the majority of its population from Lutheranism back to Roman Catholicism. In 1655, the printing press at the Trnava university produced the Jesuit Benedikt Szöllősi's Cantus Catholici, a Catholic hymnal in Slovak that reaffirmed links to the earlier works of Cyril and Methodius. The Ottoman wars, the rivalry between Austria and Transylvania, and the frequent insurrections against the Habsburg monarchy inflicted a great deal of devastation, especially in the rural areas. In the Austro-Turkish War (1663–1664) a Turkish army led by the Grand Vizier decimated Slovakia. Even so, Thököly's kuruc rebels from the Principality of Upper Hungary fought alongside the Turks against the Austrians and Poles at the Battle of Vienna of 1683 led by John III Sobieski. As the Turks withdrew from Hungary in the late 17th century, the importance of the territory composing modern Slovakia decreased, although Pressburg retained its status as the capital