In the archives the pilgrimage church was first mentioned in 1314 when the patriarch of Aquileia Ottobon granted indulgences that his predecessors granted to the visitors of the »Blessed Virgin Mary of Šmarna Gora« church, meaning the chapel was already built in the start of the 14th century or even in the end of the 13th century.
As the pilgrimage trail was more and more popular in time there was a need for a new church. They tore down the two-nave gothic church and in years 1711-12 at those time the most renowned Slovenian master builder Gregor Maček built the current central building. He was inspired by the pilgrimage church in Nova Štifta near Ribnica. In its ground floor the church is octagonal to which a rectagonal altar part with cut corners is leaned. Both parts are covered by big cupolas. The church was blessed only in 1729, which is stated also on an inscription, built into the wall between the nave and the presbytery.
In the next century the frescos in cupolas were made. In 1842 Matevž Langus painted the arch over the presbytery with the scenes from Mary's life, as well as the coulisse-like main altar. This one was renovated by Matija Koželj in late 19th century, and in addition he painted the walls of the presbytery with four evangelists and the scene of Mary's showing herself to the St. Dominic and Simon Štok.
In the years 1846-1848 the arch of the big dome was painted by Matevž Langus, who painted an ilusionistic scene of Mary's Assumption. In the upper band, the heaven, father God and Jesus Christ are already waiting for Mary in its crown the Holy Spirit in the form of pidgeon and innumerable crowd of angels. In the second band the heavenly scene is accompanied by saints and patriarch of the Old Testament. The third, lower band, presents the Earth; Mary Magdalene and her sister Martha are standing by an empty grave and the twelve disciples behind them. On the opposite, western side a crown of pilgrimages is shown, where next to the painter's self-portrait at the rock lightning the portraits of numerous Langus' contemporaries: among others the mayor of Vodice and contract giver for this painting Jernej Arko, Anton Jamnik, who was the priest of Šmarna gora at that time and the advocate for the pilgrimage of Šmarna gora the Franciscan Anton Rant. On the right to the organ case the Aljaž family from Zavrh under Šmarna gora is painted. Jakob Aljaž, whose bust portrait, the work of France Kralj, is on the famous façade of belfry, is the baby in the lap of his mother, while the father is the man with the trowel in his hand. He helped the painter apply the fresh plaster on which the artist painted immediately, that is in fresco technique. On extreme right there are two pilgrims in noble clothes, who are in oral tradition believed to be Langus' acquiantances France Prešeren and Julija Primic. Prešeren liked visiting the Šmarna gora, especially in the time of service of his uncle Jakob Prešeren, who is also buried in the cementery of Šmarna gora at the chapel of the Sad Mother of God. The result of these visits are also the Ode of pilgrimage - Šmarna gora and Romanca from Strmi grad, which tells us about the emergence of the first church of Šmarna gora.