At the beginning of the 9th century in a geographic context of frontier between the Christian world and the Muslim world like the current region of Segarra, it was important to put remarkable milestones to ideological frontiers. The Miracle del Sant Dubte (Miracle of the Holy Doubt), which took place in Ivorra in 1010, evidences this.
According to the legend, Father Bernat Oliver, in the middle of the Eucharist, doubted the presence of Christ in the bread and wine. The doubt fostered the miracle: the chalice began to drip blood.
The story, consign to the bishop Ermengol from la Seu d’Urgell—later canonised— reached Rome, where Pope Sergius IV certified the Miracle and awarded all kinds of relics to the brotherhood.
From that moment on, the little church of Santa Maria (Saint Mary), a kilometre away from Ivorra, became a pilgrimage site. In 1663, the current sanctuary opened, even if the façade dates back to almost a 100 years later, in 1762. The lavish Baroque altarpiece which dominated the nave was burned during the Spanish Civil War. In the first decade of the 21st century, the church has been adorned again with a Christ by Agnès Pla and Jaume González and a photographic altarpiece by Sebastià Caus, which makes the incidents of the miracle shine with poetics belonging to our days.