Between the 14th and 15th centuries the town expanded, owing to manufacture of textiles and a regally-mandated annual regional fair. During this period the alcaldes of the castle were the Coutinhos, that included Gonçalo Vasques Coutinho, then also alcalde of the Castle of Trancoso, who during the 1383-1385 crisis, supported the Portuguese pretender, the Master of Aviz. At the end of this period, D. Francisco Coutinho, 4th Count of Marialva ordered the construction a window in the middle of the keep tower.