Gniezno was annexed by the Kingdom of Prussia in the 1793 Second Partition of Poland and renamed "Gnesen", becoming part of the province of South Prussia. During the Kościuszko Uprising, the Polish army under General Jan Henryk Dąbrowski liberated the town on 22 August 1794 and defeated a Prussian Army north of Gnesen near Labischin (Łabiszyn) on 29 September 1794. But because of Kościuszko's defeat at the Battle of Maciejowice he gave up his plan to winter in Bromberg (Bydgoszcz) and moved through Thorn (Toruń) and retreated to central Poland. Thus, the Prussians retook it on 7 December 1794. During the Napoleonic Wars there was an uprising against Prussian rule. The French appeared in Gnesen in November 1806, and following General Jan Henryk Dabrowski's order issued to all towns and cities and country property owners to provide recruits for the organizing Polish forces, Gnesen initially provided 60 recruits who participated in the battles of 1806–07. Consequently, the town was included within the Duchy of Warsaw, but upon the defeat of Napoleon in Russia in 1812 it was occupied by the Russian army and was returned to Prussia in the 1815 Congress of Vienna. Gnesen was subsequently governed within Kreis Gnesen of the Grand Duchy of Posen and the later Province of Posen. It was an important center of Polish resistance against Germanisation policies, various Polish organizations and publishing houses were located there.