Almansur´s military expedition against Santiago in the year 997 led Bishop Cresconio (1037-1066) to rebuild the defence system created by Sisnando II (+ 968). Around the second defensive ring (deep moats and palisades) that surrounded the town (the first protected the locus Sancti Iacobi), he built another rampart with square towers and an interior walkway. In the 16th and 17th centuries, major repair and modification work was carried out on the defensive system.
The Mazarelos Arch would have been one of the gateways that led into the city. There were also six other entry points of which only their names remain: Porta da Pena, Porta do Camiño (entrance from the French Way), Porta da Mámoa, Porta Faxeira, Porta da Trinidade or de A Mahía, and Porta de Sofrades. The stilted semi-circular arch has a building adjoining the south side, which conserves the foundations of the watch tower that flanked the gateway. Both structures are built in granite masonry.