King Alfonso II founded the Monastery of San Paio de Antealtares in the year 830. It fell into decay at the end of the 13th century, and in ruins, the Catholic Monarchs eliminated it and included it into S. Martín Pinario. In 1495, Gómez de Marzoa´s efforts to set up a college for poor students led to the monastery becoming Compostela´s first school and the origin of Galicia´s Renaissance University. The Order of benedictine nuns occupied it as of 1499.
The present-day building, in baroque style, appeared between 1599 and 1744. Fernández Lechuga the closing wall of La Quintana as a large, undecorated canavas, gicving the sensation of perfection and grandeur; Velasco Agüero built the other walls of the cloister and doorway facade, with a monumental doorwayframed by four giant order Doric columns; Fernando de Casas y Novoa extended the building to the Carros Gateway, finished by Lucas Ferro Caaveiro and known as 'Puerta de la Borriquita' (the Donkey Gateway), thanks to the relief image of the Flight to Egypt (Francisco de Lens, circa. 1750). Church (Friar Gabriel de las Casas, 1703-07) in cut-stone granite and tiled, two-sided roof. Greek cross ground plan extended at the western end to accommodate the choir. Simple, monumental facade with the figure of St. Pelayo Martyr. Interior covered with a dome over pendentives. Main retable by Castro Canseco.
References:The first written record of church in Danmark locality date back to the year 1291. Close to the church are several stones with a Christian text and cross inscribed. The oldest parts of the present red-brick church are from the 1300s. In the late 1400s the church was enlarged to the appearance it has today. The church has been modified both internally and externally several times, among other things after the fires in 1699 and 1889. There are lot of well-preserved mural paintings in the walls.