In the Third Partition of Poland (1795) the town was annexed by Austria. Following the Austro-Polish War of 1809 it was regained by Poles and included within the short-lived Duchy of Warsaw, and after the duchy's dissolution in 1815, the town fell to the Russian Partition of Poland. Fights of the Polish January Uprising took place in the area in 1863. Francesco Nullo, hero of the fights for Italian and Polish independence died in the Battle of Krzykawka nearby, and then was buried at the cemetery in Olkusz. Poland eventually regained independence and control of the town after World War I in 1918.