Before 1945, the area was part of Germany (East Prussia). After World War II the region was placed under Polish administration by the Potsdam Agreement under territorial changes demanded by the Soviet Union. Most Germans fled or were expelled and replaced with Poles expelled from the Polish areas annexed by the Soviet Union or forced to settle in the area through Operation Vistula in 1947.