It was briefly occupied by the Teutonic Knights in 1339 before reverting to Poland. In 1359 it received municipal rights from Archbishop Jarosław. Shortly after a defensive castle was built which survived until 1721.
It was briefly held by the Teutonic Knights in 1339 before reverting to Polish rule. In 1359, it received town privileges from Archbishop Jarosław. A defensive fortress was built shortly afterwards, which lasted until 1721.