When the Ottoman Empire lost the 1683–1690 War of the Holy League to the Habsburg Monarchy and her allies, and ceded Slavonia and Hungary to Austria at the 1699 Treaty of Karlowitz, the northern and western borders of the Sanjak of Bosnia (corresponding largely to the modern Bosnian borders), became a permanent frontier between the Austrian and Ottoman empires.