During the Great Turkish War the Holy League could not liberate the whole territory of medieval Hungary from the Ottoman rule. The Treaty of Karlowitz (1699) ended the war in which the two parties agreed to accept the new borders between the Habsburg Empire and the Ottoman Empire which meant that the historical region of Banat stayed under Turkish rule. This agreement stayed in force until the Treaty of Passarowitz (1718) ending the Austro-Turkish War (1716–1718) in which Prince Eugene of Savoy and his army recaptured the Banat.