In spite of its newfound consolidation under Turkish rule, the town's location in strategic borderland between the Habsburg Monarchy and the Ottoman Empire made it an area of frequent conflict in the modern era. During the Great Turkish War, the Austrians, under Louis of Baden, pushed the Turks far to the south of the city. Although this occupation was short-lived, it spelled an end to consolidated Ottoman rule in the region. Soon after, in 1718, Kragujevac became a part of the Habsburg Kingdom of Serbia following conquest by Prince Eugene of Savoy and the signing of Treaty of Passarowitz. Under Austrian occupation, the area around the city was fortified, and the Muslim population driven out. As the Ottomans retook the town in 1739, and lost it again in 1789 to the same enemy, the town was ripe for new rule—this time under Serbian rebels.