Before 1945 the settlement was part of Germany (East Prussia) and known as Heydtwalde, Forst. 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 Ukrainians forced to settle in the area through Operation Vistula in 1947.