The Kingdom of Hungary between 1538 (1526) and 1867 was part of the lands of the Habsburg Monarchy, while outside the Holy Roman Empire, and formally part of its successor, the Austrian Empire. After the Battle of Mohács, the country was ruled by two crowned kings (John I and Ferdinand. Initially the exact territory under Habsburg rule was disputed because both rulers claimed the whole kingdom. Temporary territorial division occurred only in 1538 at Treaty of Nagyvárad,when the Habsburgs got the north and west parts of the country (Royal Hungary), with the new capital Pressburg (Pozsony, now Bratislava). John I secured the eastern part of the kingdom (known as Eastern Hungarian Kingdom). After 1541 the central and southern counties were effectively annexed by the Ottomans for 150 years.