The origin of the cave as a cult place is controversial. According to traditional storytelling. Pelagius, the Visigothic king of Asturias, while chasing a criminal, who had taken refugee in the cave, met a hermit who was worshipping Virgin Mary. The hermit asked Pelagius to forgive the criminal, since hel had resorted to the protection of the Virgin, and added that Pelagius himself would someday need to seek shelter in the Cave.
Some historians suggest that Pelagius and the Christians, after seeking refugee in the cave to escape tha Muslims, brought an icon of Virgin Mary and left it there after their victory in the Battle of Covadonga, the begin of the Reconquista.