 There was a castle already in the 1367, when it was still under the rule of local Polish dukes of the Piast dynasty.In later periods the settlement was also part of Bohemian Crown, Hungary and Austria.The settlement suffered during the Thirty Years' War in the 17th century and in 1740 it was annexed by Prussia.