The first written mention of defensive walls appears in 1316, although they probably existed before. The city fortifications received their present, partly preserved form in 1479–1480; this was a double ring of walls with towers on a rectangular and semi-cylindrical plan complemented with a system of moats and ponds. The city had three gates: the Upper Gate from the east, the Lower Gate from the west and the Nicholas Gate from the south. During the Napoleonic Wars, the walls were significantly damaged, and a dozen or so years later, in 1841, the decision was made to transform the fortification remains into a promenade – a picturesque walking avenue with a number of representative buildings.