<P> When Mexico achieved its independence in 1821 with the Treaty of Córdoba, the Captaincy General of Guatemala that had ruled Central America became politically independent as well, without the necessity of violent struggle . Guatemala declared its own independence September 15, 1821, likely to prevent the Mexican Army of the Three Guarantees from "liberating" Guatemala and over-riding nascent local autonomy . However, Guatemala chose to be annexed to the First Mexican Empire, led by royalist - turned - insurgent military leader Agustín de Iturbide, who was proclaimed emperor of Mexico in 1822 . When Iturbide abdicated from the monarchy and Mexico took steps to be a republic, Central America claimed its independence . </P> <P> The Cuban War of Independence was the last of three liberation wars that Cuba fought against Spain, the other two being the Ten Years' War (1868--1878) and the Little War (1879--1880). The final three months of the conflict escalated to become the Spanish--American War. A contingent of US Navy ships blockaded several Cuban ports . The Americans decided to invade Cuba and to start in Oriente, where the Cubans had control . </P> <P> After several failed revolts, the Portuguese colony of Brazil declared independence, forming a separate, local empire founded by Prince Regent Dom Pedro I . The war between the Brazilians and Portuguese lasted from February 1822, with the burst of first skirmishes between militias, to November 1823, when the last Portuguese garrisons surrendered . The Brazilian Empire lasted until a coup in 1889 overthrew the monarchy leading to its current status as a republic . </P> <P> The crisis of political legitimacy in Spain with the Napoleonic invasion sparked reaction in Spain's overseas empire . The outcome in Spanish America was that most of the region achieved political independence and instigated the creation of sovereign nations . The areas that were most recently formed as viceroyalties were the first to achieve independence, with the old centers of Spanish power in Mexico and Peru with strong and entrenched institutions and elites were the last to achieve independence in this era . The two exceptions to independence were the islands of Cuba and Puerto Rico, which with the Philippines, remained Spanish colonies until the 1898 Spanish - America War . </P>

How did the haitian revolution impact latin american independence