 During the colonial era it was a key port for the export of Peruvian silver to Spain and for the import of enslaved Africans under the asiento system.It was defensible against pirate attacks in the Caribbean.Modern Cartagena is the capital of the Bolívar Department, and had a population of 1,028,736, according to the 2018 census, making it the second-largest city in the region, after Barranquilla, and the fifth-largest city in Colombia.