In 1517, when the Spanish arrived, Campeche was only a small Mayan village named Ah Kim Pech. The Mayas of the area were very hostile toward the Spanish, and it was only after about 25 years of hostilities that the Spanish managed to establish what would become the city of Campeche.
During the Spanish time, the city was regularly attacked by pirates. During that time, a great wall was built around the city (in 1663). Nowadays, it's still possible to see the fortified walls around the city, mansions from the 18th and 19th centuries, and several well restored pastel-coloured buildings.
The Comalcalco ruins are unique in the Mayan world since they have been built with bricks or oyster shells. The site was at its peak between 600 and 1,000 AD.