 After the Third Partition of Poland the town was taken by the Habsburg Empire (1795).In the years 1809–1815 it was in the Duchy of Warsaw, later in the Russian-controlled Congress Poland (1815–1915).In 1829 Dezydery, the last of the Chłapowski family, sold the town to Kazimierz Tański, a Polish general who participated in the Kościuszko Uprising and Polish national liberation struggles in the early 19th century.