The earliest mention in a written document regarding the walls dates from 1326. They were also mentioned in 1339 when papal legates accepted Warsaw as the location for the Polish-Teutonic trial. According to the trial documents, Warsaw was a "safe place, as it is surrounded by a wall".
The first brick structures of the first line of defensive walls were the New Town Gate to the northwest, on the side of the future New Town, and the Krakow Gate to the south, in the area of today's Castle Square. The privilege issued on November 23, 1379, by Duke Janusz I obliged residents to surround Warsaw with a wall in such a way that the city was enclosed within its ring. In total, the walls, about 1200 meters long, encompassed an area of approximately 8.5 hectares.
By the 15th century, these fortifications seemed insufficient, so the construction of a second line of walls from the castle to the Marshal's Tower began. At a distance of 9 to 14 meters from the original line of walls, between the mid-15th and early 16th centuries, a second, lower line of walls was erected. The difference in height between the top of the second line and the battlements of the first line was about 4 meters, and in front of the second wall, a moat about 4 meters deep was dug. The thickness of the wall in the old fortifications was 1.2 meters, while in the new one it was 1.8 meters. The shorter height of the wall allowed not only for the use of artillery but also for attacking the enemy from 2 levels of walls simultaneously.
By the 16th century, these fortifications were already outdated due to the development of artillery, and the Barbican itself no longer had any significant military value. Settlement in the Warsaw area was already outside the city walls in the 14th century.
Between 1621–1624, a new line of earth-bastion fortifications was constructed, known as the Zygmuntowski Rampart, which was situated much farther from the city walls.
During the Swedish Deluge, the walls suffered damage, which was not repaired in later years. During this period, the walls played their last military role. People stopped taking care of the walls because they no longer had a defensive significance and instead hindered the city's development.
In the 17th century, the dismantling of the walls slowly began. For convenience, new passages were made, though the gates and towers remained in good condition. In the 18th century, buildings, initially wooden, were attached to the walls, which were replaced by brick buildings in the 19th century. In the 18th century, Warsaw was surrounded by new ramparts, known as the Lubomirski Trenches, which served as a sanitary cordon around the city. In the 19th century, the city gates were also destroyed, being too narrow for the needs. By the second half of the 19th century, the walls were almost entirely covered by extensions and rental tenements.
The role of fortifications defending the city was taken over by fortifications in the suburbs – built during the Kościuszko Uprising, and later in the 19th century during the time of the Duchy of Warsaw, the November Uprising, and finally the ring of forts along with the citadel forming the Fortress of Warsaw, erected during the period of the Congress Kingdom.
The first renovation attempts were undertaken in 1936 under the direction of Jan Zachwatowicz at the initiative of the city council.
Reconstructed sections of the walls from the 1930s survived World War II. After the war, works began in 1949. Between 1950 and 1955, there were efforts to rebuild all the fortifications. During this period, among others, the Barbican and the Powder Tower were reconstructed.
The final stage of conservation work involved excavating a brick bridge from under the pavement of Castle Square, which led to the former Kraków Tower. On the square, strips of clinker bricks were laid showing the former course of the double line of walls.
Between 2007 and 2009, the walls were thoroughly renovated. Their foundations were dried, moisture insulation was installed, brick structures were cleaned and strengthened, and wall illumination was installed with 296 ground spotlights (including 27 operating in a dynamic color change system). The illumination in 2009 received the Jean-Paul L'Allier Award for the best project related to the revitalization and conservation of an area listed on the UNESCO list.
In April 2011, pedestrian paths located between the inner and outer defensive wall were named: Piotr Biegański's Interwall (section from Castle Square to Piekarska Street) and Jan Zachwatowicz's Interwall (section from Piekarska Street to the Vistula escarpment).
In the Barbican, there is an exhibition of the Warsaw Museum dedicated to its defensive walls.