The early human occupation dating back to his local Celtic tribes. At the time of the Romanization of the Iberian peninsula, the village was known as then existing Miróbriga, integrating the jurisdiction convent of Pax Julia (current Beja).
Occupied by Alans during the first decades of the fifth century, was abandoned in the sixth century, and the population moved to the nearby hill, closer to the sea. The new town was successively dominated by the Visigoths and in the beginning of the second decade of the eighth century, by the Muslims, when it became known as Kassen.
At the time of the Christian reconquest of the peninsula, Santiago do Cacém was first taken in 1158, in the context of the conquest of Alcacer do Sal, by the forces of D. Afonso Henriques (1112-1185). Likewise, it would be recovered between 1190 and 1191 by the forces of the Caliph Almóada Abu Yusuf Ya'qub al-Mansur.
Since 1186, D. Sancho I had donated to the Order of Santiago the areas of Almada, Palmela and Alcácer do Sal. The first two had been reconquered previously 1194; the last remained in Muslim possession until 1217.
In that year, under the reign of King D. Afonso II (1211-1223), Santiago do Cacém was definitely conquered by Portugal, when their fields were also donated to the Knights of the Order; these warrior monks started the reconstruction of its defenses.
From this period, the settlement becomes known by its current place name: Santiago do Cacém, dating this stage its first charter.
Under the reign of King D. Dinis (1279-1325), the castle was in possession of Vataça Lascaris (Dona Vetácia), a lady-in-waiting and friend of Queen Santa Isabel, from 1315 until 1336, when it was returned to the Order of Santiago.
At the time of the crisis of 1383-1385, was one of the first villages to state party to the Master of Avis, since D. Fernando Afonso de Albuquerque, Master of Santiago, was made ??available at your service all the resources of his Order.
Under the reign of King D. Manuel I received new charter (1512).
At the time of the Philippine Dynasty, Philip II of Spain donated the castle to the dukes of Aveiro (1594).
The defense of the village has lost strategic importance after the War of Restoration, in the seventeenth century. The area of the castle returned to the possession of the Crown in 1759. Since then the old castle was abandoned and gradually came into sharp process of ruin. Its dependencies were used in the nineteenth century as the village cemetery.
In the twentieth century, on June 23, 1910, was declared as a National Monument. More recently, interventions have been promoted for consolidation and restoration by the Direcção-Geral dos Edifícios e Monumentos Nacionais (DGEMN).
-- Source