Construction began in 1158, although changes were made from the fourteenth to sixteenth centuries that added Gothic features.
The hen and rooster kept within the church refer to a miracle in which a boy, on pilgrimage with his family, turned down the advances of the innkeeper's daughter. Angered, she and a friend hid some of the church's silver in his pack. He was arrested, hung, and left there to warn the people against stealing. His family continued their pilgrimage to Santiago de Compostela and when they passed back through town, they found that their son still was alive, having been supported by Saint James (or Saint Dominic in some versions). The parents went to tell the judge, who did not believe them. He was roasting chickens and said that their son was as alive as the chickens he was cooking, at which point they came to life and flew away.