On the first day of the invasion of Poland, which started World War II on September 1, 1939, the Germans entered the town, but were forced to withdraw. They entered again on September 5. In the following days the "Einsatzgruppe III" entered the town to commit crimes against Poles. Poles arrested during the "Intelligenzaktion" were imprisoned in the local prison. In October 1939 the Germans carried out the first executions of Polish residents, while first mass expulsions of over 500 Poles were carried out in December 1939. The expelled Poles were predominantly local activists and owners of better houses, which were then handed over to German colonists as part of the "Lebensraum" policy. Also a transit camp for Poles expelled from nearby villages was operated in the town. Despite such circumstances, the Polish resistance movement was organized in the town. In January 1945, the town was taken over by the Soviets, who imprisoned soldiers of the Polish Home Army here. Later on, the Soviet-appointed communists organized a prison here for political opponents, of which 142 died here.