<P> Formally, it is considered that the fight for independence culminated in the Battle of Ayacucho, on December 9, 1824 . </P> <P> The Chilean Independence movement was led by the Liberator General Bernardo O'Higgins . This movement of Chilean - born criollos, who sought political and economic independence from Spain . The movement for independence was far from gaining unanimous support among Chileans, who became divided between independentists and royalists . What started as an elitist political movement against their colonial master, finally ended as a full - fledged civil war . Traditionally, the process is divided into three stages: Patria Vieja, Reconquista, and Patria Nueva . </P> <P> The first uprising against Spanish rule took place in 1809, and criollos in Ecuador set up a junta on September 22, 1810 to rule in the name of the Bourbon monarch; but as elsewhere, it allowed assertion of their own power . Only in 1822 did Ecuador fully gain independence and became part of Gran Colombia, from which it withdrew in 1830 . At the Battle of Pichincha, near present - day Quito, Ecuador on May 24, 1822, General Antonio José de Sucre's forces defeated a Spanish force defending Quito . The Spanish defeat guaranteed the liberation of Ecuador . </P> <P> Independence in Mexico was a protracted struggle from 1808 until the fall of royal government in 1821 and the establishment of independent Mexico . In the Viceroyalty of New Spain, as elsewhere in Spanish America in 1808, reacted to the unexpected French invasion of the Iberian peninsula and the ouster of the Bourbon king, replaced by Joseph Bonaparte . Local American - born Spaniards saw the opportunity to seize local control from Viceroy José de Iturrigaray, who may well have been sympathetic to creoles aspirations . Iturrigaray was ousted by pro-royalists . A few creole elites sought independence, including Juan Aldama, and Ignacio Allende, but especially secular parish priest Miguel Hidalgo y Costilla . Hidalgo made a proclamation in his home parish of Dolores, which was not recorded in writing at the time, but denounced bad government and gachupines (pejorative for peninsular - born Spaniards), and declared independence . The unorganized hordes following Hidalgo wrought destruction on property and the lives of whites in the region of the Bajío . Hidalgo was caught, defrocked, and executed in 1811, along with Allende . Their heads remained on display until 1821 . His former student José María Morelos continued the rebellion and was himself caught and killed in 1815 . </P>

When did latin america gain independence from spain