The monastery was founded in the 10th century by Osorio Gutiérrez, the holy count, who on his death was buried in its temple, in a 6th-century Paleochristian marble sarcophagus from Aquitaine. The sarcophagus can be seen in the chapel of Valdeflores (18th century) in the monastery church.
From the first centuries of the monastery's history, an ark from the 9th century and a tombstone from the 12th century have been preserved. In the latter century, it went from being a family congregation to becoming dependent on the Benedictine Order and, at the beginning of the 16th century, it came under the influence of Saint Benedict of Valladolid. In the 19th century, with the Spanish confiscation of ecclesiastical properties, the monastery began to decline, until between 1910 and 1942, when monastic life was revived with the arrival of monks from Samos. Once this community was dissolved, and after some time as a Diocesan Minor Seminary, dependent on the bishopric of Mondoñedo, the Town Council took over the building and turned it into the Town Hall.
The medieval character of the building was lost with the refurbishing that took place during the 17th and 18th centuries. It was precisely in the second third of the 18th century when the Baroque façade of the monastery church was completed by the architect Fernando de Casas Novoa, considered a precedent for the Obradoiro façade of Santiago Cathedral.
Since the 1960s, the building has also housed an interesting Museum of Sacred Art.
In 1974, the complex was declared a Historic-Artistic Monument.