The castles of Bragança, Outeiro (Bragança), Castle of Algoso and Castle of Miranda do Douro, supported by the small fortresses of Vimioso and Penas Roias, formed the northwest defensive line of the Kingdom of Portugal with the Kingdom of León, which in 1493 the king John II of Portugal called the “corregimento das fortresses of Trallos Montes”.
In a dominant position over the top of Penenciada, it dominates the surrounding plain and the confluence of the Angueira and the Maçãs rivers. In the region of North Region, Portugal, from the top of its walls you can see Serra da Sanábria, Serra de Bornes and of Serra da Nogueira. It has a 360 degree view of the Mirandese platea, located at an altitude of 690 meters, next to the Angueira river.
Archaeological excavations permit conclusions associated with early settlement before the Middle Ages, there existed a castle on the current site, that supported various settlements, identified with the Chalcolithic period (that include Bronze Age moulds), proto-historic and Roman (such as the discovery of ceramics associated with a period of non-military settlement).
During the Christian Reconquista, the primitive frontier of the County of Portugal with the Kingdom of León extended along the left bank of the Sabor River, to its confluence with the Angueira River. This link was watched by various sentinel outposts: the Castle of Milhão, the Castle of Santulhão (both today long disappeared), the Castle of Outeiro de Miranda (in ruins) and in the eastern edge, the Castle of Algoso. The remainder of the principal defense occurred in the northwest, across the protector of the Castles of Penas Róias, Mogadouro and Bragança.
Sometime during the 12th century, D. Mendo Rufino (or Bofino), master of the lands of "Ulgoso" by donation of D. Afonso Henriques, ordered the construction of a fortress, in order to watch and guard the frontier with the Kingdom of León. From information during the 1258 Inquirições, Mendo Rufino (who was one of the supporters of Afonso Henriques against D.