On October 9, 1820, #Guayaquil became the first city in #Ecuador to gain its #independence from #Spain. The #people were very happy about the independence and celebrated, which is now Ecuador's independence day, officially on May 24, 1822. The rest of Ecuador gained its independence after Antonio José de #Sucre defeated the #Spanish Royalist forces at the Battle of #Pichincha, near #Quito. Following the battle, Ecuador joined Simón Bolívar's Republic of #GranColombia, also including modern-day #Colombia, #Venezuela and #Panama. In 1830 Ecuador separated from Gran Colombia and became an independent republic.
A territorial dispute between Ecuador and #Peru was the source of the longest-running international armed conflict in the Western Hemisphere. After independence all of Spain's colonial territories signed and agreed to proclaim their limits in the basis of the principle uti possidetis juris which accepts the Spanish colonial borders of 1810 as the borders of the new republics. Thus the borders of Gran Colombia would follow the borders of the #Viceroyalty of #NewGranada, and Peru the Viceroyalty of Peru in 1810. However, Peru was not satisfied with this and tried to set the date of her Uti Possitedis to 1824- a time when Peru was officially independent with territories Peru militarily occupied since 1820. Tumbes and Jaen de Bracamoros, to which Peru had no colonial titles, were territories that declared their independence in 1820 and were militarily occupied by Peruvian patriot forces that convinced the people in these territories to join Peru. Because of this, Peru claims that part of its western territorial borders where it lacks title is derived from free determination of its people in the border areas after independence.