The church was damaged by the soldiers under General Madeira during the Brazilian fight for independence in 1822. It was abandoned and in ruin by 1941. IPHAN carried out significant restoration works during this period, including reconstruction of the roof, the lining of the main chapel, stabilization of the walls, replacement of cement floors with ceramic tiles and restoration of carpentry and carving. This work was finished in 1944. General restoration work was carried out again in 1977.