During the joint German-Soviet invasion of Poland, which started World War II in September 1939, the town was invaded and then occupied by Germany. On September 12, 1939, the German "Einsatzgruppe VI" entered the town to commit various atrocities against Poles as part of the "Intelligenzaktion". The Germans carried out mass arrests of local Poles under the pretext of "gathering, plotting, mistreating the Volksdeutsche and anti-German activity". Arrested Poles from the town and county were imprisoned in a newly established Nazi prison, and then hundreds were massacred in the nearby Bytyń, Kobylniki and forests between October 1939 and January 1940. On October 12–13 and December 13, 1939, the Germans also carried out public executions of Poles in the town. In December 1939, the Germans carried out first expulsions of Polish intelligentsia and owners of shops and workshops, which were then handed over to German colonists as part of the "Lebensraum" policy. Further expulsions of Poles were carried out in 1940–1941 and 1944. Despite such circumstances, the Polish resistance movement was active in the town, and structures of the Polish Underground State were organized. The Germans also destroyed the pre-war monument of Polish insurgents of the Greater Poland Uprising. In 1945 the German occupation ended and the town was restored to Poland, although with a Soviet-installed communist regime, which remained in power until the Fall of Communism in the 1980s. In June 1945, the Home Army carried out a successful attack on a communist prison and liberated captured resistance members.