The town originated in Celt settlement and survived during the Roman occupation of the Iberian Peninsula, and systematically influenced by cultural shifts initiated by the Suebi, Visigoths and the Moors by 8th and 9th centuries.
Following the campaigns to take Galicia, in 1135, Afonso Henriques was encouraged to restore castles, monasteries and churches in strategic places along the Miranda do Douro.
Aiming to build up the settlement and defense in their time of peace, the village received tenure in 1136, coming to be in place Couto and safe haven.
The struggles between D. Sancho I and his son/successor, Afonso II, along with support from Alfonso IX of León, resulted in the lands Miranda being occupied by Leonese forces who, ultimately, returned the castle to Portugal, in 1213.
Miranda do Douro became its own diocese and was elevated to city status through a royal letter dated 10 July 1545 (issued by D. John III).
Following the Restoration Wars, in 1664, King D. John IV ordered the reconstruction of the castle, with work initiated to prepare the site for its use by artillery.
[1] But, in 1762, there was an explosion in the powder magazine, that resulted in the obliteration of 22,500 kilograms (49,600 lb) of munition, destroying a great part of the citadel, the destruction of the square within the next three months.
[1] On 1 June 1992, the property was placed into the management of the Instituto Português do Património Arquitetónico (Portuguese Institute of Architectural Patrimony), by Decree 106F/92 (Diário da República, Série 1A, 126).
[1] The castle includes courtyard, a primitive military square, and a cistern with access by stairs, obstructed and protected by metallic railing.