Sweden acquired control of the town at the Peace of Westphalia ending the Thirty Years' War in 1648.
After World War II the region was placed under Polish administration by the Potsdam Agreement under territorial changes demanded by the Soviet Union.