The transition from Visigothic reigns to the Muslim conquest of Iberia was very obscure, representing a period of decline for the city. The Moors briefly captured Braga early in the 8th century, but were repelled by Christian forces under Alfonso III of Asturias in 868 with intermittent attacks until 1040 when they were definitely ousted by Ferdinand I of León and Castile. As a consequence, the bishopric was restored in 1070: the first new bishop, "Pedro" (Peter), started rebuilding the Cathedral (which was modified many times during the following centuries).