The Castle of Lamego () is a medieval castle located in the civil parish of Lamego (Almacave e Sé), in the municipality of Lamego, Portuguese district of Viseu. History Early human settlement in the territory dates to the Bronze Age, although it may have been inhabited by the Lacão peoples beginning in the 5th century B.C. With the Roman occupation of the Iberian Peninsula, the Emperor Trajan ordered the reconstruction of the village, then called Lameca, from simple villa to civitas. Between the 5th and 8th century, it was settled by the Visigoths, and became the seat of a bishopric (marked by the Basilica of São Pedro de Balsemão). In the 8th century, Moors occupied the territory. Following the Christian Reconquista of the peninsula, the village was conquered by Ordoño II of Galicia in 910. It was then reconquered in 997, by the forces of Almansor and caliphate of Cordoba, and would remain their possession until the 11th century. On 29 November 1057, the city was conquered from the Moors by Ferdinand I of León. Sometime in the 12 century, the tower keep and dungeons were constructed, followed in the 13th century by the fortification walls. The territory and its castle were given away in the dowry during the marriage of Henry of Burgundy and Teresa of Leon, and integrated into the lands of Portucalense (the County of Portugal). With its independence, they were donated to the Mendes (the Masters of Bragança) who initiated a series of construction projects in the 12th century, such as the keep tower, dungeons, the walls and cistern erected by Moors in the 11th century. During the reign of King D. Sancho II (1223–1248), Abril Peres de Lumiares was alcalde was until 1245. It is believed that after the 1258 Inquirições (Inquiries), during the reign of King D. Afonso III (1248-1279), that the elaborate walls were erected. 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. Following a brief economic recession in