The beginnings of the fortifications in Trnava date back to 1238, when the town received the privilege of building them from king Bela IV. Initially, these were timber and earth ramparts, gradually exchanged in the 14th century for the brick one. Despite the fortifications, the town was capured many times, among others in 1271 and 1273 by king Ottokar II of Bohemia. In 1430, in the foreground of the town, the Hungarian army fought with the Hussites, who despite the victory had to retreat to Moravia, due to great losses. Two years later, a group of Hussites disguised as merchants, entered the town, overpowered the guard at night and took over the town without a fight. They occupied Trnava until 1435, and in the same year, after regaining the Trnava, Emperor Sigismund of Luxembourg ordered the town fortifications to be strengthened. The next attack on the town was carried out in 1506 by Maximilian Habsburg. This time, the defenders kept the town, although fortifications were badly damaged during the fights. In subsequent centuries, along with the spread of artillery, town walls were losing importance, but were maintained. The first demolition was carried out in the nineteenth century, when the moat was filled in and the gates were demolished in order to make street traffic easier.
The town fortifications in Trnava were erected on a rectangular plan with dimensions of 800 x 700 meters. This area was divided into about two equal halves by a stream that ran through the Trnava from north to south, forming a small bend in the central part of town. In the south, beyond the defensive circuit, it flowed into the Trnavka river, which protected the town from the west. The eastern part of the town was older, located on the left bank, initially concentrated around the parish church of St. Nicholas, the younger part developed on the right, west bank of the stream. Both were connected in the fourteenth century by a mutual defensive circuit.
The fortifications covered an area of almost 56 ha with a circumference of 3,000 meters. This placed Trnava among the larger urban centers of Hungary at the time. All the most important churches and sacred complexes were located near the town walls: the parish church in the middle of the eastern side of the town, the monastery of Poor Clares in the south-east corner built already at the time of the foundation of Trnava, the Franciscan monastery in the middle of the west side, and the Dominican monastery near the north-east corner. The brick defensive wall was around 8 meters high and the thickness reaching up to 2 meters. At the beginning it was crowned with a battlements, but in a later period it received a simple roof over the sidewalk of defenders. The latter was placed in the wall thickness behind the breastwork.
Fortifications were reinforced with 36 towers, spaced fairly evenly over the entire length of the perimeter. Originally there were 26 of them, in the second phase of the extension of fortifications in the 14th century, another 10 were added to the existing circuit. A smaller number of towers was only on the eastern side. Initially, it were half towers, open from the side of the town, over time rebuilt into quadrilateral towers. The length of their sides was from 7,25 to 8,1 meters. They protruded in front of the curtain facades on both sides and were one storey higher than them. Inside, individual floors were separated by wooden ceilings, and communication was provided by ladders. Defense was made possible by rectangular loop holes, splayed into the interior. Inside, individual floors were separated by wooden ceilings and communication was enabled by ladders.
Four gates, located in four-sided, five-storey gatehouses, led to the town. Two from the north (Upper and Malženická) and two from the south (Lower and Lovčická). This unusual layout was probably caused by the terrain conditions, i.e. a stream that separates the town into two parts and the need to provide each of them an independent entry. Later, smaller pedestrian wicket gates were added, one from the east and two from the west, while the main town gates received foregates in the fourteenth century. The outer zone of defense was a moat, filled with water at times of danger, from a pond located north of the town. Its width was about 20 meters, and the depth was at least 5 meters.
The defensive walls in Trnava belong to one of the best preserved in Slovakia. It survived on 2/3 of the circuit, especially on the western, northern, north-eastern, eastern and partly southern sections, along with numerous towers.
Lexikon stredovekých miest na Slovensku, red. Štefánik M., Lukačka J., Bratislava 2010.
Mencl V., Stredoveka mesta na Slovensku, Bratislava 1938.
Stanik I., Pôvodný zámer výstavby stredovekého opevnenia Trnavy a jeho postupná realizacia [w:] Trnava a poèiatky stredovekých miest, Trnava 2009.