After the capitulation of the nasrid city of Almería (1489), the new Castilian administration was able to verify the state of ruin of its defences due to the earthquake of 1487, ordering the rapid construction of a castle on the highest point of the battered hispano-muslim Alcazaba.
Between 1490 and 1502 the castle was built, incorporating in its design the most effective systems of the time to repel an attack with gunpowder. The typological references of this military installation correspond to the School of Valladolid; with a long tradition in the construction of castles.
In parallel with the completion of these works, the Catholic Monarchs ordered in 1501 to armor the defence of the coasts of the Kingdom of Granada, articulating and extending the medieval system of watchtowers scattered along the coast, to counteract the fragility of the annexed territories, the mestizaje of its people, and the proximity of Africa. Thus concluded the works in the Castle, the works were centred in the repair of the walls of the city, action that will extend to the fences of the Alcazaba (1526).
Towards 1547, attacks by turkish and berber pirates followed one another on the Almeria coast in the face of the defencelessness of the population. These incursions led to concern about the proper conservation of military installations. As a consequence of this, the old Alcazaba was adapted to the distant war offered by the use of gunpowder.
The first interventions were designed by Luis de Machuca, architect of the Palace of Carlos V in the Alhambra. This accommodation included the construction of the bastions of the Campana (1550) and the repair of the doors of Justice and the Guard (1565), completing the program due to the proximity of the War with the Moriscos, with the construction of the bastions of the San Matías and Espolón (1568).