After a particularly blistering pirate assault in 1663, the remaining inhabitants of Campeche set about erecting protective walls around their city. Built largely by indigenous labor with limestone extracted from nearby caves, the barrier took more than 50 years to complete. Stretching more than 2.5km around the urban core and rising to a height of 8m, the hexagonal wall was linked by eight bulwarks. The seven that remain display a treasure trove of historical paraphernalia and artifacts of varying degrees of interest. You can climb atop the bulwarks and stroll sections of the wall for sweeping views of the port.
Two main entrances connected the walled compound with the outside world. The Puerta del Mar provided access from the sea, opening on to a wharf where small craft delivered goods from ships anchored further out. (The shallow waters were later reclaimed so the gate is now several blocks from the waterfront.) The Puerta de Tierra, on the opposite side, was opened in 1732 as the principal ingress from the suburbs. It is now the venue for a sound-and-light show.