Afonso I of Portugal
The castle was built by the moors. During the Iberian peninsula's Reconquista period, Santiago do Cacém was taken for the first time in 1157 in the context of the conquest of Alcácer do Sal by the forces of Afonso I of Portugal (1112–1185). The forces of Almohad caliph Abu Yusuf Ya'qub al-Mansur retook the city in 1190–1191.