In September 1939, Soviet authorities forced most residents to leave the town, as Soviet-German border was established nearby (see Molotov–Ribbentrop Pact). The inhabitants returned to the town in mid-1941, after German invasion of the USSR.