The Castle of Moreira de Rei (Portuguese: Castelo de Moreira de Rei) is a well-preserved medieval castle located in the civil parish of Moreira de Rei, in the municipality of Trancoso, Portuguese district of Guarda.
A castro probably existed on the site of the fortification and was later re-appropriated by the Romans.
By 960 A.D. the first reference to the castle of Moraria appeared in the will of D. Flâmula Rodrigues. It was donated to the Convent of Guimarães in the intervening years. In 997, it was taken by Almançor, and remained in the possession of the caliphate until 1055, when it was reconquered by forces of Ferdinand I of León. Superficial vestiges of interior foundations were discovered indicating the first structures constructed on the site were attributed to the 12th century.
The first foral (charter) was conceded by D. Afonso Henriques; the territory remained in the hands of Fernão Mendes of Bragança until his death, when it reverted to Crown. In 1217, the foral was conferred by King D. Afonso II. Sometime in 1247, the site was a staging location for King D. Sancho II, before his exile to Toledo.
The Rol dos Besteiros (1422) suggested that 1065 inhabitants occupied the grounds around the castle, yet the 1496 Inquirição (Inquiries) determined little more than 202 residents.
In 1512 a new foral was issued, resulting in the castles dominion by Fonseca Coutinho and, later, the Marquess of Castelo Rodrigo. Shortly after (in 1527), the Numeramento (the census of the kingdom) suggested a population of 428 inhabitants.
In 1853, during a visit by Alexandre Herculano, the author indicated an advanced state of destruction and ruin. During this period, the courtyard was used as a quarry.
Between 1920 and 1930, Father Júlio César Gomes advocated/promoted that materials should not be used from the site for local buildings. By this time there continued to exist two cisterns: one at the hilltop covered in vaulted ceiling and another to the northwest. The first efforts to restore the site occurred in 1942 by the Direcção Geral dos Edifícios e Monumentos Nacionais (General-Directorate for Buildings and National Monuments) involving the restoration of the walls and corners, a task that was continued the following year and 1945, that included rebuilding the walls and reinforcement, along with excavaton ad leveling of dirt.
The site is a mix of natural, rural and urban landscaping, occupying the extreme incline of a hilltop 819 metres (2,687 ft) above sea level, that includes granite stones and poulders incorporated into the construction. The site overlooks the valley and old village, that includes vestiges of the walls a little distance from the pillory and Church of Santa Marinha, while to the south are the castles of Trancoso and Marialva.
The castle's fortifications are formed by a double line of walls, with the exterior portion largely incomplete, save for some lines along the east, south and north. The interior walls form an irregular oval, with a curtain of walls devoid of merlons in the east. The northern limits, marked a linear wall is largely defended by rock boulders of large dimensions. Still visible is the base of a rectangular keep tower in the northwest, while elements of a rectangular tower to the northeast are visible. Over the rocky surface to the northeast are marks of the wall foundations, creating an orthogonal inflection. The centre of the courtyard was excavated to reveal a rectangular deposit.
Remains of the urban perimeter wall are limited to segments in the area once occupied by a northern gate.