 The military defended the country's sovereignty when Spain attempted to reconquer Mexico, the French invaded to collect debts, and Anglo-American settlers in Texas fought for their independence.In 1846, the United States provoked the Mexican–American War, which ended two years later with Mexico ceding almost half its territory via the Treaty of Guadalupe Hidalgo to the United States.Mexican liberals overthrew him in 1854, initiating La Reforma, a liberalizing movement.