Dominating the mountaintop of the territory of the Baixo Alentejo, the walls that encompass Aljustrel were once occupied since the Neolithic and Chalcolithic, with the latter evidence in the fragments of flint and ceramics discovered at the site.
[1] It is unclear when the structure was used in a military capacity, but there are suggestions that it began during the late Muslim occupation, around the 13th century, at the time of the fortress of Alcácer do Sal.
[1][3] The castle was not the only fortification to be added to the immediate defensive lines, many of the Muslim strongholds along the Algarve were incorporated into the Crown's possessions, including the mines at Aljustrel.
[1] The presence of D. Paio Peres Correia, Master of the Order of Santiago was, therefore, not unusual to the wider expansion of the Kingdom, since it became a staging ground for further attacks to the south, during the 13th century.
[1] The castle is situated on an isolated hilltop, some 247 metres (810 ft) above sea level, dominated by a panoramic view of the nearby landscape, near the Church of Nossa Senhora do Castelo.