It used to be the seat of the Teutonic prosecutor. In 1656, during the Polish-Swedish war, the fortress fulfilled its defensive role for the last time. From the mid-17th century the castle began to decline and finally was abandoned. The city authorities only made matters worse, giving the castle bricks to the local inhabitants for the purpose of flat building. Therefore, the tower and one of the castle wings were demolished. Currently, offices are housed in the renovated building.