After gaining independence in 1821, the country was left in a poor state. Agricultural, mining and industrial production had fallen during the war, and over half a million Mexicans had died. As a new country, Mexico was struggling internally to achieve nationhood.