 After a protracted struggle (1810–21) for independence, New Spain became the sovereign nation of Mexico, with the signing of the Treaty of Córdoba.At independence in 1821, the Mexican economy was in ruins, the treasury was empty, and the brief Mexican unity against Spanish rule disappeared.A brief period of monarchy (1821–23), the First Mexican Empire, which was overthrown in 1823.