The Kingdom of Hungary became a Habsburg dependency, because an agreement made in Vienna in 1515 said that the Habsburg family would take over the territory of the Jagellion family in Bohemia and Hungary if the line of kings should die out. In 1686, the Ottomans were forced to leave, and the country was reunified. Many nationalities were living in the country at this time. Along with Hungarians, there were also the ancestors of modern Slovaks, Serbs, and Romanians.