Cartagena de Indias was founded on 1 June 1533 by Spanish commander Pedro de Heredia, in the former location of the indigenous Caribbean Calamarí village. The town was named after Cartagena, Spain, from which most of Heredia's sailors came. Initially, life in the city was bucolic with fewer than 2000 inhabitants and only one church. A few months after the disaster of the invasion of Cote, a fire destroyed the city and forced the creation of a firefighting squad, the first in the Americas. The dramatically increasing fame and wealth of the prosperous city turned it into an attractive plunder site for pirates and corsairs (French privateers, licensed by their king). Just 30 years after its founding, the city was pillaged by the French nobleman Jean-François Roberval. The city then set about strengthening its defenses and surrounding itself with walled compounds and castles.
During the seventeenth century, the Spanish Crown paid for the services of prominent European military engineers to carry out the construction of the fortresses which are today Cartagena's most significant identifying features. Engineering works took well over 208 years and ended with some eleven kilometers of walls surrounding the city, including the Castillo San Felipe de Barajas, named in honor of Spain's King Philip IV. It was built during the governorship of Pedro Zapata de Mendoza, Marquis of Barajas and was constructed to repel land attacks, equipped with sentry boxes, buildings for food and weapons storage, and underground tunnels.
Cartagena was a major trading port, especially for precious metals. Gold and silver from the mines in the New Granada and Peru were loaded in Cartagena on the galleons bound for Spain via Havana. Cartagena was also a slave port; Cartagena and Veracruz, (Mexico), were the only cities authorized to trade with black people. The first slaves arrived with Pedro de Heredia and worked as cane cutters to open roads, in the desecration of tombs of the aboriginal population of Sinú, and in the construction of buildings and fortresses. The agents of the Portuguese company Cacheu distributed human 'cargoes' from Cartagena for mine exploitation in Venezuela, the West Indies, the Nuevo Reino de Granada and the Viceroyalty of Perú.
On 5 February 1610, the Catholic Monarchs established from Spain the Inquisition Holy Office Court in Cartagena de Indias by a royal decree issued by King Philip II. The Inquisition Palace, finished in 1770, still exists with its original features of colonial times. When Cartagena declared its complete independence from Spain on 11 November 1811 the inquisitors were urged to leave the city. The Inquisition operated again after the Reconquest in 1815, but it disappeared entirely when Spain surrendered six years later before the patriotic troops led by Simón Bolívar.