The church and adjoining monastery were built by the Spanish Trinitarians between 1741 and 1746, under Pope Benedict XIV
. The architect was the Portuguese Emmanuel Rodriguez dos Santos
. The interior decoration was completed by the Spanish architect José de Hermosilla y Sandoval
. In 1784, the church and convent came under the direct protection of the Spanish monarchy.
The church underwent the first renovation and upgrades, completed in 1788.
In 1895 the church was assigned to the Spanish Dominicans, who remain in charge. The convent is now described as a Cultural Institution and College of Religious.