The monastery was founded in the 11th century by
Alfonso II of Asturias as a
Benedictine monastery originally staffed by twelve monks. It was initially aimed to look after and render worship to the newly discovered tomb of the
Apostle James, which brought a pilgrimage status to the city. Once the Benedictine monks left the monastery in 1499, it was occupied by cloistered nuns and dedicated to
Pelagius of Córdoba, a 10th-century Galician child captured, martyred by order of the
Caliph Abd-ar-Rahman III of
al-Andalus after his refusal to renounce of his Christian faith. The present-day construction is almost entirely from the 17th and 18th centuries. ==See also==