Leskovac was severely damaged by fire in 1595 and again in 1690. In the Ottoman-Austrian War the  towns Serbs overwhelmingly sided with Habsburg forces on arrival in 1689. Following the failed uprising many Serbs migrated north after the Ottomans recaptured Leskovac, razing the Serbian quarters as reprisals for collaboration. In 1790 Sultan Selim III administrative reforms granted Leskovac the seat of its own Eyalet governed by Şehsuvar Abdi Pasha, who was succeeded by his son Ismail Pasha in 1830, until the Leskovac Eyalet was annexed to the Niš Eyalet in 1839. The Serbian population of Leskovac (along with other south Serbian towns and villages) took part in the failed rebellion of 1841. During the Serbian–Turkish Wars (1876–1878) Leskovac lost one third of its population comprising approximately 5,000 Muslims (mostly Slavs and Albanians) that fled the advancing Serbian Army and cheta who liberated Leskovac on December 24, 1877 ending 424 years of Ottoman rule.