The structure was probably expanded, extended and strengthened up until the mid-12th century. The church successfully withstood the Tatar-Mongol raid of 1241, providing shelter for the majority of residents and inhabitants of the city. At that time, it was – quite rightly – called “the lower castle” to be distinguished from the nearby “upper” standing on top of the Wawel Hill. It was also sometimes referred to as the second church of Kraków after the Wawel Cathedral. In 1320, the church was entrusted to the Order of Poor Clares, whose convent was built south of the church. Also the brick, Gothic oratorio that today plays the role of the sacristy dates back to that period.