Cartama's origins can be traced as far back to the time of the Phoenicians. They were the ones who dubbed the place "Cartha", which means "hidden city". This was already after they established a community in Malaga.
From the moment the Romans moved in up until the time they left six centuries after, many developments took place here. This was confirmed by the discovery of numerous archaeological sites in the area, which revealed heaps of sculptures, mosaics, and ewven remnants of Roman burial grounds and roads.
One important archaeological find is the second century AD column that is now known as the Humilladero Cross. Cartama, which was already named "Cartima" by the Romans then, was very popular for its public baths because their waters were believed capable of healing diseases and ailments.
When the Iberian Peninsula fell under Moorish rule, Cartama became one of its prized locations. Being situated at the end of the rio Guadalhorce's navigable waters, the Moors immediately recognized its strategic importance in Malaga's lines of defense - the river banks of Cartama provided the best place to launch an attack to the provincial capital.
It is for this reason that they constructed a formidable fortress overlooking the entire village and its surrounding landscape. It is believed to have been constructed in the 10th century and served its purpose especially in the 13th and 15th centuries, during the Reconquista and Granada War.
The strategic value of the town was confirmed when records of the castle's downfall in the hands of the Catholic Monarchs were found in the bas-reliefs of the Coro in the Cathedral of Toledo.
Unfortunately, the castle - just like many Moorish castles in the region - was not restored to its original form and they had no intention to. Such was the practice then. In fact, Moorish structures, especially those with religious value, were torn down and Christian replacements were constructed in their stead.
One such construction was that of the Church of Saint Peter of the Apostle, which was built on top of a mosque. You can actually find many churches in Malaga that bear similar origins.