According to the medieval story, János Schmuckenpfennig, a citizen of Sopron, was involved in a murder.
The culprit, as punished by Pope Boniface IX, donated a plot of land, where construction began in 1393 and the church was built within five years. The church was used by evangelicals between 1555 and 1673. After the fire of 1676, the Jesuits restored the building in Baroque style. A statue of Mary and St Joseph was placed on the façade. The eight side chapels and the entire interior wall were decorated with stucco. Its altars, statues, pews and pulpit are richly decorated in Baroque style. The church houses the oldest organ in Hungary, the work of the Viennese master Johann Wöckherl from 1633. In 1869, the Baroque tower attached to the main façade was pulled down to the street. The new 55-metre-high tower was built on the opposite side of the church, on the rondelle of the castle wall. It bears the Latin inscription 'Built for the glory of God in 1882'. The restoration after the devastation of the World War has revealed the medieval parts found under the Baroque architecture.