The Kingdom of Hungary between 1526 and 1867 existed as a state outside the Holy Roman Empire, but part of the lands of the Habsburg monarchy that became the Austrian Empire in 1804. After the Battle of Mohács in 1526, the country was ruled by two crowned kings (John I and Ferdinand I). Initially, the exact territory under Habsburg rule was disputed because both rulers claimed the whole kingdom. This unsettled period lasted until 1570 when John Sigismund Zápolya (John II) abdicated as King of Hungary in Emperor Maximilian II's favor.
In the early stages, the lands that were ruled by the Habsburg Hungarian kings were regarded as both the "Kingdom of Hungary" and "Royal Hungary". Royal Hungary was the symbol of the continuity of formal law after the Ottoman occupation, because it could preserve its legal traditions, but in general, it was de facto a Habsburg province. The Hungarian nobility forced Vienna to admit that Hungary was a special unit of the Habsburg lands and had to be ruled in conformity with its own special laws. However, Hungarian historiography positioned Transylvania in a direct continuity with the medieval Kingdom of Hungary in pursuance of the advancement of Hungarian interests.