These were years in which warfare dominated the affairs of Ecuador. First, the country found itself on the front lines of Gran Colombia's efforts to liberate Peru from Spanish rule between 1822 and 1825; afterward, in 1828 and 1829, Ecuador was in the middle of an armed struggle between Peru and Gran Colombia over the location of their common border. After a campaign that included the near destruction of Guayaquil, the forces of Gran Colombia, under the leadership of Sucre and Venezuelan General Juan José Flores, proved victorious. The Treaty of 1829 fixed the border on the line that had divided the Quito audiencia and the Viceroyalty of Peru before independence.