The city walls were erected in the beginning of the 14th century. Access to the city was offered by four gates called Wodna, Toruńska, Boczna, and Łasińska. The castle was accessed from the city by the Castle Gate, which neck connected with the outer settlement of the Teutonic stronghold. Ten towers were built on the walls. The walls had been constantly expanded and fortified throughout centuries. Some walls were pulled down as a result of expansion of the city in the late 19th century. Structures that have been preserved include the southeast corner with the ground floor of the tower and a waterworks tower in the southern stretch of the walls, which in the past was used to draw water from the Trynka Canal (today, it runs underground). The water tower is one of the oldest water supply systems in Poland.