It is the most important monument of military architecture in the municipality. The exact date of its construction is not known, but it is thought to date from before the 1209 charter of Afonso IX of León. The fortification has undergone many alterations over the years and it was after the reforms of King Dinis that the castle was surrounded by a barbican, which meant that access to the inside of the fortress had to be made via an enclosed route. King Manuel I ordered the restoration of the walls again after some years, and it was only in 1922 that this monument was recognised as a National Monument. It underwent its final restoration in 1940.