The long series of Habsburg expeditions weakened the Ottoman Empire and forced its military out of Hungary-proper. The country was secured for Charles III in 1685, two years into the Great Turkish War. Its population "almost entirely wiped out", Kunság was opened for Cuman repopulation: land was assigned to tight groups of Cumans who had served in the Habsburg military forces. In 1702, with Habsburg acquiescence, Kunság was mortgaged to the Teutonic Order. Though formally reduced to near-serfdom, Cumans were able to hold on to some of their tax and judicial privileges. Nevertheless, their social decline led them to join other Kuruc rebels during Rákóczi's War of Independence (1703–1711).