A small church stood on the site of today's church as far back as the Romanesque period. In 1371, a Gothic church was built by Peter of Šternberk on the site of an older Romanesque church. At the same time, Albert II brought the Augustinian Order to the town, and they subsequently established a monastery. The church dilapidated beyond repair and was demolished in 1775.
A new Greek-Revival building was erected at the site. The new church, built according to the design of F. A. Grimm, was finished in 1783. Soon after that, Emperor Joseph II abolished the Augustinian monastery and the church became a parish church. The main altar picture was painted by the local painter, Josef Dickl, while the ceiling fresco was created by Johann Christoph Handke. The church is 65 metres long and the nave is 30 metres high. The church collection includes a replica of the Madonna of Šternberk, as the original of this Baroque statue is in the Archdiocesan Museum in Olomouc.