Iturbide's army was joined by rebel forces from all over Mexico. When the rebels' victory became certain, the Viceroy of New Spain resigned. On August 24, 1821, representatives of the Spanish crown and Iturbide signed the Treaty of Córdoba, which recognized Mexican independence under the terms of the Plan de Iguala, ending three centuries of Spanish colonial rule.
During the struggle for independence, Mexico lost one-tenth of its citizens. In the decade following separation from Spanish rule, Mexico saw a drastic decline in its gross domestic product (GDP), per capital income, and amount of foreign trade.