The Royal House of the Maestranza was built by Iñigo Melchor Fernández de Velasco, Constable of Castile and León and Captain General of Galicia between 1665 and 1668. It was built with stone from the demolition of houses in the A Moureira neighbourhood, which had been left abandoned at the end of the previous century. It was a one-storey building with four wings and a large central courtyard, whose initial function was to house soldiers in transit during the war with Portugal (1640–1668).