The town was annexed by the Soviet Union from September 17, 1939 until June 1941. Its Polish inhabitants, particularly students of the local high school, organized a failed uprising in January 1940, which would serve as the first Polish uprising of World War II. From 1941-1944 it was annexed to Nazi Germany. After the defeat of the Nazis by the Red Army in 1944, the town returned to Soviet control until in 1991 it became part of independent Ukraine. The Jewish residents were persecuted and deported as part of the Holocaust. The surviving Polish residents of the town were transferred to the Recovered Territories in the immediate postwar period (see Polish population transfers (1944–1946)).