Documented since the end of the 10th century as an ancient hermitage center, in the 11th century it became dependent on the monastery of Sant Llorenç de Morunys. A church was built there in the fifteenth century, and between 1582 and 1634 a community of Dominican friars was established there. The increase in his patrimonial assets led to the construction of a new temple between 1774 and 1785, which came to serve, in 1812, as a depot for French prisoners and was devastated in 1836 during the Carline War; a cannon from that time is preserved there, located at the entrance to the sanctuary. The current building was built on the initiative of the industrialist Esteve Monegal between 1867 and 1870, and was inaugurated on August 19 of this year.
In 1896 a great fire, perhaps caused by lightning, completely destroyed the high altar and the paintings representing the legend. The image of the Virgin Mary was rescued and the temple was repaired. In 1901, a new high altar was inaugurated, this time financed by José Monegal. In 1929, the two Masriera canvases were installed there, replacing the previous two, burned in the 1896 fire.
After the family that lived in the Sanctuary left at the end of the sixties of the 20th century, in 1971 Father Jordana, coming from the Monastery of Poblet, who had been Prior-President of Poblet and of the Spanish Cistercian Order, arrived in La Mola to reside there and lead a retired life. In 1975, a new reconstruction of the Sanctuary began and in the following years, electric light and running water were added. In 2008, the Hostatgeria del Santuari was inaugurated there, a "eucharistic, biblical place, a place to transmit the peace of God