 In 1794, Tadeusz Kościuszko initiated an unsuccessful insurrection in the town's Main Square which, in spite of his victorious Battle of Racławice against a numerically superior Russian army, resulted in the third and final partition of Poland.In 1809, Napoleon Bonaparte captured former Polish territories from Austria and made the town part of the Duchy of Warsaw.Following Napoleon's defeat, the 1815 Congress of Vienna restored the pre-war boundaries but also created the partially independent Free City of Kraków.