The basilica was erected in stages beginning in 1340 until about the mid-15th century. It was intended as a monastery church, which explains the large plot of land on which it stands, and the presence of a monastic cemetery next to it. In 1404 King Władysław II Jagiełło gave it to the Canons Regular of the Lateran, a congregation which he had brought in from Kłodzko.[1]