Before 1939 the area was part of Poland, with a large East Slavic population. Under the terms of the Molotov-Ribbentrop Pact it was allocated to the Soviet Union, and was annexed to the Ukrainian SSR.