It was conquered in 1158 by D. Afonso Henriques, but was retaken in 1191 by the Arab Moors, as evidenced by the construction of the pentagonal tower during its occupation.
It was definitively reconquered in 1217, by King D. Afonso II, who donated it to the Order of Santiago. This military religious order remained seated in Alcácer do Sal until its move to Mértola. Beginning in 1289, the castle and fortifications were rebuilt.
In 1570, Rui de Salema and his wife, D. Catarina de Souto Maior, founded the Convent of Nossa Senhora de Aracaeli, to house/shelter the sisters of Poor Clares/Order of Saint Claire. The nuns were housed in the interior of the castle in the old residences of the former Commandery of the Order of Santiago and Royal Palace.
Following an earthquake in 1969, the site was damaged. The unstable accessways along the walls were reinforced in 1971, along with repaving the foundations, filling of cracks along the parapets and the masonry (to imitate the taipa removed from the site). This was extended in 1975 to include work along the western wall of the clocktower. Between 1982 and 1983, the restoration of the adarves and battlements were undertaken, and continue the restoration of the walls and turrets. This turret was immediately reconstructed in 1985 in stone masonry, with imitation taipa. In successive years (1986, 1987 and 1988) there were recovery works: reconstruction, improvement and consolidation of the walls and turrets.