In 1540, when Spanish troops captured the Mayan port of Kin Pech on the Gulf of Mexico, they found an unexpected treasure: a small, scrawny tree that grew all over the nearby forests -- and from which a gorgeous, red-orange dye could be made.
That was a big deal back in Europe, where only the rich could foot the hefty bills for purple capes, red waistcoats and other bright clothes dyed with the juices of rare bugs, exotic plants and the like. Commoners could only afford clothes dyed with cheap, drab materials. Like soot.
Soon, galleon loads of the Kin Pech trees began showing up in Spain, and news that a cheap source of colorful dye had been found blasted across the continent like a cannonball. The sooty set could now dress like the silky set.
All this from a little tree simply called logwood.
Back in Campeche, as the Spanish renamed the city, fortunes were made by everyone from the logwood forests' new owners to the slave brokers who imported laborers to cut the trees. And the town showed it. Campeche's streets, it's said, "were lined with fabulous mansions and churches full of gold and silver and the finest Chinese porcelain."
The only problem was, all this was a red flag to the pirate fleets prowling the Gulf waters from their hangout a few hundred miles down the coast at Ciudad del Carmen. Over the next century, they raided Campeche so often that it became one of the most frequently sacked spots in the New World.
The solution - although late in coming -- was to build a huge, eight-sided wall around the city with a fortress on each corner bristling with cannons. When it was finished in 1704, the wall ran over a mile and a half long. It was six and a half feet thick and almost as high as a three-story building.
The pirates never came back.
Campeche thrived as the second richest city (after Veracruz) in eastern Mexico for another century and a half until the mid-1800s, when European inventors figured out a way to make artificial dyes.
So what's the town like today? As you might expect, it's grown a lot -- close to a quarter-million people live there -- but the downtown area is much like it was hundreds of years ago. More than a thousand mansions, churches, government offices and other buildings have been restored to their colonial elegance along the city's cobbled lanes. What's more, a large section of the city is still framed by the old wall and its gun-studded bastions.
Besides its historical attractions, Campeche offers some of the best bargains in the country. For example, rooms in the city's tourist-class hotels can often be found for less than $75 a night including breakfast. And you'll find stunningly low prices in the handicraft shops around town, especially for woven goods and ceramics.
Beyond that, Campeche is packed with great restaurants (featuring fresh seafood, also at low prices), it's safe to walk around in (even late at night) and it's close (roughly a half-hour drive) to Edzna and other spectacular Mayan ruins out in the jungle.
Until a few years ago, the once-great city of Edzna was one of the lesser known sites of the Mayan empire. That was before actor/director/producer Mel Gibson turned the city into a set (complete with an Aztec-style sacrificial pyramid) for his controversial movie, Apocalypto.
The local folks don't think much of the film's historical accuracy, but they admit it's done wonders for tourism.
Getting, staying there
Jet hops from Mexico City to the Campeche airport take a little over an hour and a half. From there, it's about a 20-minute cab ride to the city.
Visitors have a choice of a dozen or so tourist-class hotels ranging from cozy inns to luxurious five-star properties. At some, modest colonial exteriors give way to posh interiors, such as in the 15 rooms of Starwood Hotels' Hacienda Puerta Campeche just across the street from the city's historic wall.
Photo credits: First three images courtesy of the Campeche Tourism Board. Last two images by Bob Schulman.
HuffPost Lifestyle is a daily newsletter that will make you happier and healthier — one email at a time. Learn more