Kościan was captured by the Swedes during the Swedish invasion of Poland (the "Swedish Deluge") in 1655, but was soon recaptured by a partisan unit led by Krzysztof Żegocki. The town suffered from further Swedish and Russian invasions in the 18th century, and was annexed by Prussia in the Second Partition of Poland in 1793. The Polish Greater Poland uprising of 1794 began in Kościan. In 1807 the town became part of the short-lived Polish Duchy of Warsaw, before being reannexed by Prussia in 1815, and it was restored to Poland after the country regained independence in 1918.