The largest blow to Mexico was the U.S. invasion of Mexico in 1846 in the Mexican–American War. Mexico lost much of its sparsely populated northern territory, sealed in the 1848 Treaty of Guadalupe Hidalgo.  Despite that disastrous loss, Conservative Santa Anna returned to the presidency yet again and then was ousted and exiled in the Liberal Revolution of Ayutla.