The church was built in the Gothic style on the initiative of the Bishop of Chełm, Mikołaj Kościelecki, and his successor, Bishop Jakub Buczacki, and was completed after 1518. The presbytery and sacristy that still exist today were built at that time.
The church burned down after being struck by lightning in 1712, and was then rebuilt in the Baroque style on the initiative of the Bishop of Poznań, Antoni Onufry Okęcki. It was probably then that the main nave that still exists today was built.
Around 1846, a neo-Gothic façade was added. In 1932, a bell tower was built.
The church stands on the site of an older wooden church mentioned in the 13th century, and which may have existed as early as the 12th century.