Before the Portuguese conquest of the region, the fields were donated to the Knights Hospitaller. They were first brought under the control of Gonçalo Egas, having been granted a Foral charter to the town aiming to encourage their settlement and defense in 1226. A will date from this period under the reign of Sancho II (1223–1248), directing the reconstruction of the fortification.
A Foral charter was granted to the town by King Afonso III (1248–1279) in 1254.
Under the reign of King Dinis (1279–1325), the village received a new charter. in 1296, confirmed in 1298. During this period, the original castle was renovated, increasing to three towers.
During the 1383–85 Interregnum crisis, the village suffered one attack and took refuge in the castle. It was relieved by forces of the Order of Aviz.
In 1580, the castle was brought under Habsburg control when Portugal joined Spain in the Iberian Union.
The castle is considered a Public Interest Property by decree on July 18, 1957. Since it is in well conserved condition, the castle is a tourist attraction for the community.