Manila has endured several deadly earthquakes , notably in 1645 and in 1677 which destroyed the stone and brick medieval city . The Earthquake Baroque style was used by the Colonial architects during the Spanish colonial period in order to adapt to the frequent earthquakes .