It originated as a small medieval sanctuary, consisting of a modest shrine containing a fifteenth-century fresco depicting a Madonna and Child. Around 1590 a shooting party passed by and a huntsman accidentally struck the image of the Virgin. According to legend, she began to bleed. The penitent huntsman added his arquebus to the shrine and began to collect the large sum of money which would be needed to repair the damage and expiate his sin. Today the arquebus is preserved in a chapel of the sanctuary near the fresco which it had disfigured.
In time the place became a centre of pilgrimage. An early visitor was the duke Charles Emmanuel I of Savoy who, in 1596, commissioned the construction of a large sanctuary from the court architect Ascanio Vitozzi. However the death of both the duke (who had wanted to be buried here), and of the architect, put a stop to the building work.
Construction was resumed in the eighteenth century under Francesco Gallo who built the great elliptical cupola which has major and minor diameters of 36 and 25 metres (118 and 82 ft) respectively. It is said that Gallo was required to remove the scaffolding himself, as nobody thought that a structure of this type would be able to stand on its own.
The decoration in fresco of the 6,032 square metres (64,930 sq ft) of the cupola’s vault was completed in 1752 by Mattia Bortoloni and Felice Biella, and the sanctuary finally attained its current form in 1884, when the campanili were built along with the three façades.