Why is Campeche ringed by walls? Because it was so rich the whole world wanted to steal it. For nearly two centuries this Gulf port was the gateway for the silver, dyewood and precious timbers of the Yucatán Peninsula — and, for that reason, a favourite target of the pirates of the Caribbean. The city you now wander in peace, with its pastel façades and cobbled lanes, was born of that threat: it is one of only two walled cities in Mexico and the best preserved in all of continental North America.

This is the story of how fear built one of the most beautiful cities in the country.

A port too rich for its own good

Founded by the Spanish in 1540 over the Maya chiefdom of Ah Kin Pech, San Francisco de Campeche quickly became the peninsula's only authorised port. Cargoes crossed the Atlantic from its docks toward Seville: silver, cacao and, above all, palo de tinte (logwood), a timber yielding a black-and-violet dye so valuable it once traded almost like gold in the looms of Europe.

That prosperity came at a price. A laden galleon anchored off an undefended town was, quite simply, an invitation.

Two centuries under siege

From the mid-16th century, Campeche endured wave after wave of attacks. The roll call of raiders reads like a who's who of piracy: the Englishmen Francis Drake and John Hawkins, the Dutchman Cornelis Jol — nicknamed "Peg Leg" — Diego el Mulato and the dreaded Laurens de Graff, "Lorencillo". The cruellest blow fell in 1685, when a pirate fleet seized the city and sacked it for days.

After that disaster, the Spanish Crown made a decisive choice: to wall the entire city.

Cannons atop a bastion of Campeche's city wall

Cannons and bastions: the Bastions Route still girds the old town.

The stone hexagon

Between 1686 and 1704, an irregular hexagonal enclosure rose: some 2.5 kilometres of stone curtain walls up to eight metres high, reinforced by eight bastions at the corners and pierced by two monumental gates. The Sea Gate faced the Gulf; the Land Gate faced the interior. At night they were closed with chains, and the city was sealed like a strongbox.

The system worked. The great raids ceased, and Campeche entered a long era of prosperity that left behind the historic centre we admire today: stately courtyard houses, Baroque churches and a perfectly legible grid plan.

What survives today

The Puerta de Mar (Sea Gate) of Campeche's walled enclosure

The Puerta de Mar, where the walled city opened onto the Gulf.

A UNESCO World Heritage Site

In 1999, UNESCO inscribed the Historic Fortified Town of Campeche on the World Heritage List, recognising it as an outstanding example of the urban military architecture of the colonial Caribbean ports. It is not a stage set: it is a living city where people still inhabit the old houses, open their cafés and celebrate each neighbourhood's festivals.

Sleep inside the walled enclosure, in a house that is part of its history.

Discover Casa Muralla →

How to experience pirate-era Campeche today

The best way to understand these defences is to walk them. Begin at the Land Gate at dusk, follow the rampart and link up with the bastion-museums; our walled city guide maps the full itinerary. To go deeper into what those bastions hold today — including the jade mask of Calakmul — continue with the museums of Campeche, and to understand how the city organised itself beyond the walls, read about the five traditional neighbourhoods. If you are planning your trip, see also when to visit Campeche and why it pays to stay inside the walls.

The walls of Campeche illuminated at night

At night, the walls recover the calm that followed centuries of siege.

Frequently asked questions

Why is Campeche a walled city?

Because for nearly two centuries it was one of the most coveted ports on the Gulf of Mexico. After decades of corsair and pirate raids, the Spanish Crown financed a ring of bastions and curtain walls, completed around 1704. That defensive system is, in large part, what UNESCO recognised as a World Heritage Site in 1999.

Who attacked Campeche?

Some of the most feared names in the 17th-century Caribbean: corsairs and pirates such as Francis Drake, John Hawkins, Diego el Mulato, Laurens de Graff (Lorencillo) and Cornelis Jol, 'Peg Leg'. The most devastating sack came in 1685, when a pirate fleet held the city for days.

What survives of the defences today?

Two monumental gates — the Land Gate and the Sea Gate — and seven of the original eight bastions, now museums, gardens and viewpoints. Much of the curtain wall is preserved or restored, and a stretch can be walked on foot.

Can you walk the city walls?

Yes. The Land Gate (Puerta de Tierra) has a walkway along the rampart and a nighttime light-and-sound show several times a week. The San Carlos, Santiago and Soledad bastions are open to the public as museums.

Where should I stay to experience the historic city?

Inside the walled enclosure, in a restored heritage home. Staying among the bastions lets you reach the gates, museums and seafront promenade on foot — and return to a house that is part of the very heritage you came to see.