[2] After visiting Amsterdam in 1481, Emperor Maximilian I decreed that the town was to build stone walls to safeguard against attacks by the Duchy of Guelders and the Bishopric of Utrecht.
[2] The end result was a brick wall, 5 to 6 metres high, supported by stone arches.
The walls encircled the entire town, with the exception of the harbour front on the IJ bay along the northern side of the city.
Immediately following the Alteratie in 1578, the city began to strengthen the weak spots in its defenses.
For instance, a bastion was constructed by the Haarlemmerpoort gate, which at that time lay near Herenmarkt square.
The city was expanding so rapidly that the area between the old and new walls was filled with new houses within a matter of a few years.
[1] Amsterdam in 1657 began to construct fortifications to protect its fourth and largest 17th-century city expansion.
Thousands of labourers transported soil and sand from the dunes and the Gooi using carts and wheelbarrows.
Kilometers of retaining walls were built, canals were dug, and bridges and sluice gates were constructed.
[1] The walls rested on a nine metres deep wooden floor, supported by over 100,000 piles with crossbeams.
During the Rampjaar of 1672, the Dutch Water Line proved sufficient to stop the invading French troops from taking Amsterdam.
In 1769, for instance, the Muiderpoort gate collapsed, and in 1794, part of the Reguliersbolwerk bastion sank into the canal.
The final remaining curtain wall, between the bastions Rijkeroord and Slotermeer, was demolished in 1862 and replaced with a path for strolling.
[1][5] During the Industrial Revolution in the second half of the 19th century, the city started expanding beyond its 17th-century walls.
The Prussians were unable to overcome these defenses, but managed to get by the posts using the poorly defended entrance by the Haarlemmermeer.
The Defence Line has survived largely intact and was named a World Heritage Site in 1996.
Remains of the Medieval defensive works include the Waag (originally Sint Antoniespoort gate) and the bottom half of Munttoren tower (originally Regulierspoort gate), as well as the defensive tower Schreierstoren and the watchtower Montelbaanstoren.
On 19 June 2007, part of the Medieval walls was briefly exposed when a four metres deep hole was dug to inspect the foundations of the Waag.