It's domains, originally members of a farm called "Foxem", owned by the Municipality of Évora, were donated, in the early years of the second half of the thirteenth century, to Egídio Martins, staying in possession of his descendants.
After the death of D. Martim Gil, lord these areas, the King D. Dinis (1279-1325) took possession of them, giving charters to the town (1313).
After that started the construction of the castle and walls of the village. In the following year (1314), the village and its fields were donated by the sovereign to his son, the future King D. Afonso IV, with the clause of not pierce anyone except his wife, the Castilian Infanta D. Beatriz, what he actually did in 1357, just days before he died.
Under the reign of King D. João II (1481-1495), its defenses were renewed.
In the following centuries, however, disappeared some of its reference points, especially the surrounding moats and bridges for which it acceded to the castle.
The castle was declared a National Monument on June 23, 1910. The intervention of the government, however, only occurred in the 1940s, with construction works by the Directorate-General for National Buildings and Monuments, and proceeded to consolidation and restoration work on the walls and the battlements.
-- Source