After a period of abandon, it was re-populated sometime in the 12th century, during the reign of King Sancho. During the reign of his successor (Sancho II), following the model of Évora the settlement was conceded a Foral and a formal castle was built in 1228. It is likely that the walls were erected after the construction of the keep, around the 14th century during the sequence of the reforms initiated by King D. Denis (or later by King D. Fernando, during his battles with the Kingdom of Castille). The fact that the town was issued a new foral (under the reign of King D. Sancho II) and received a fair charter (under King D. Denis) proves the regional importance of the locality.
In the 15th century, the alcalde of the castle was Manuel Sardinha, who was succeeded by Pêro Zuzarte. By 1422, there was a reference to approximately 2130 inhabitants living on the hilltop, from the Rol dos Besteiros. But, by the end of that century (1496), the Inquirição identified less than 144 residents on the site. The sites importance was reversed in 1510, with the renovation of the foral by King D. Manuel, who initiated a campaign of public works at the castle, that included the placement of a Manueline emblem over the main gate. In 1522, the alcadery was given to Garcia Zuzarte, then D. Manuel's custodian.
In 1527, the town was elevated to seat of royal county under the administration of King D. John III, headed by Luís da Silveira, his custodian. The Numeramento (royal census) indicated 383 habitantes. The site's importance continued decline, with its military structures repurposed for other military roles and its northwest gate closed-off and the battlements were reconstructed.