During World War II, the town was under German occupation from September 5, 1939 to January 22, 1945, the area having been made part of the Reichsgau Wartheland. The Polish population was subjected to various crimes, including murders, deportations to Nazi concentration camps and expulsions. Inhabitants of Margonin were among 41 Poles murdered in the nearby village of Morzewo on November 7, 1939. On December 10–12, 1939, the Germans expelled many Polish inhabitants to the Warsaw District of the General Government in German-occupied central Poland. The Germans operated a Nazi prison in the town and a forced labour camp for Jews. The Polish underground resistance movement was active in Margonin, and many of its members died in concentration camps, after the Germans discovered their operations. Following World War II, the area reverted to Poland.