The church was built in 1241, before the establishment of the Portuguese Republic, as a church for the Royal Portuguese Wedding. It was partially damaged in the earthquake of 1531 and completely destroyed in the earthquake of 1755. It was rebuilt soon, but was not completed until 1907. In 1959, the church was damaged by fire, and many important oil paintings and sculptures were damaged. After reconstruction, there are still many remains of the original fire.