During the Great Turkish War (1683–1699) on 11 September 1697, near Senta in the eastern Bačka took place one of the most decisive defeats in Ottoman history, the Battle of Zenta. Christian forces of the Holy League (1684) led by Prince Eugene of Savoy in a surprise attack destroyed the Ottoman army crossing the river Tisza. The battle resulted in a spectacular victory for Austria. As a result, in 1699 the Treaty of Karlowitz was signed, ending the Ottoman control in much of Central Europe. All the lands of the Kingdom of Hungary (except for Banat and a small chunk of Eastern Slavonia) conquered by the Ottomans in the previous 150 years were returned. Under the rule of Leopold I the Bačka became a possession of the Habsburg Monarchy. Bács-Bodrog County was established in the western parts of the region and it was re-integrated into the county system of the Kingdom of Hungary, while some other (mostly eastern) parts of the Bačka were incorporated into the Tisza-Maros section of Habsburg Military Frontier, which was directly administered by the Imperial Habsburg court in Vienna. There were significant differences in the status of the inhabitants of the feudal county and the privileged newcome settlers of the Military Frontier, who composed mostly of ethnic Serbs. The Grenz infantry of the Military Frontier was primarily formed to defend Austria against the Ottoman Turks, but impliedly it was intended to offset and control the Hungarian population. This position was several times used by the Habsburg rulers as a political and tactical instrument in the following centuries.