The Christian tradition has it that Pelagius, chasing a criminal who had taken refuge in the cave, met a hermit who was venerating the Virgin Mary.
Muslim chronicles about the Battle of Covadonga say that in this cave Pelagius's forces fled, feeding on honey bees left in the crevices of the rock.
The first construction in the Holy Cave dates back to the reign of Alfonso I of Asturias, who, to commemorate Pelagius's victory over the Muslims, built a chapel dedicated to the Virgin Mary.
The cave was covered with wood, and in 1777 a fire destroyed the medieval Marian statue; the current wooden image of Virgin and Child dates to the 16th century and was donated to the sanctuary by the Cathedral of Oviedo in 1778.
The chronicler Ambrosio Morales noted in his work that Alfonso X of Castile ordered the removal of Pelagius and his wife's to the Holy Cave of Covadonga.