One notable casualty in the Battle of Mohacs was the Hungarian King, Louis II. Following his death his brother-in-law, Ferdinand I of Austria, made a claim for the Hungarian throne. However, this claim was strongly contested by many of the Hungarian nobles. Once Ferdinand I was finally recognized as the ruler of the area that is now Slovakia, or "Royal Hungary" as it was known, the Kingdom of Hungary effectively became a part of the Habsburg Empire.
The Habsburg's main goal was to protect Europe from any further Turkish invasions. "Royal Hungary" was a convenient buffer zone between Vienna and the Turks, and Slovakia once more found itself as a battlefield, this time for the Habsburg - Ottoman war. Bratislava, as the capital of Royal Hungary, now saw the coronation of 19 Habsburg sovereigns as Kings and Queens of Hungary. Bratislava remained the capital of Hungary until the Turks were finally ousted from Central Europe, in 1786, and Buda became the capital city.

