 In 1239, after Princess Kinga of Poland was engaged to Bolesław V the Chaste in Wojnicz, the settlement was granted town rights, although no documents are extant to confirm this.It was first recorded as a town, with a defensive wall in 1278.In 1379, the town was badly affected by a fire.