The image of the Virgen del Pueyo, which disappeared in the XVIII century, was venerated at the highest point of the village of Cuevas, hence the name “El Pueyo”. On the wall that should occupy the altar there is a rock that could be preserved because it is considered the place of the Miracle, as that area was formerly known.
The hermitage must have already existed at the end of the 15th century since there is a document from 1481 that names the Confraternity of Santa María and another one shortly after that mentions Santamaría del Poyo (1493).
In the pastoral visit of 1601 it is mentioned, although it is said that it needs to be re-roofed. In the 17th century it was remodeled as we know it today, with a centralized floor plan and a dome decorated with sgraffito.