According to legend, the founder of the church was Bolesław Krzywousty. The appearance of the oldest temple is unknown. Historical sources from 1273 refer to a building erected around the middle of the 13th century. It was a stone three-nave building, which, however, burned down in 1339. A new temple was built in the years 1340-1369. At that time, the interior was covered with a cross-ribbed vault, and the body was covered with a gable roof. Further expansion was made in the 15th century, adding a chapel, sacristy and a side nave by the presbytery. After another fire in 1554, the walls of the presbytery were raised, leveling them with the walls of the naves, and the roofs were replaced with three parallel ones covering the individual naves. In 1725, the Baroque Olive Chapel was built. In 1764, the roof burned down. During the reconstruction, the tower received a new eight-pitched spire.