<P> Following upheaval caused by the May Revolution, along with the independence movements in Chile and Venezuela, local struggle for independence kicked off with two failed revolutions that . Over sixteen years of struggle followed before the first steps towards the establishment of a republic were taken . </P> <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>

Who liberated the northern areas of latin america