Before 1945, the area was part of Germany (East Prussia). After World War II the area was placed under Polish administration according to the post-war Potsdam Agreement. 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.