Since Ecuador's separation from Colombia on May 13, 1830, its first President, General Juan José Flores, laid claim to the territory that was called the Real Audiencia of Quito, also referred to as the Presidencia of Quito. He supported his claims with Spanish Royal decrees or ''Real Cedulas'', that delineated the borders of Spain's former overseas colonies. In the case of Ecuador, Flores-based Ecuador's ''de jure'' claims on the following cedulas - Real Cedula of 1563, 1739, and 1740; with modifications in the Amazon Basin and Andes Mountains that were introduced through the Treaty of Guayaquil (1829) which Peru reluctantly signed, after the overwhelmingly outnumbered Gran Colombian force led by Antonio José de Sucre defeated President and General La Mar's Peruvian invasion force in the Battle of Tarqui. In addition, Ecuador's eastern border with the Portuguese colony of Brazil in the Amazon Basin was modified before the wars of Independence by the First Treaty of San Ildefonso (1777) between the Spanish Empire and the Portuguese Empire. Moreover, to add legitimacy to his claims, on February 16, 1840, Flores signed a treaty with Spain, whereby Flores convinced Spain to officially recognize Ecuadorian independence and its sole rights to colonial titles over Spain's former colonial territory known anciently to Spain as the Kingdom and Presidency of Quito.