There, on August 10, 1809, came one of the first calls in Latin America for independence from Spain,[1] led by the city's criollos, including Carlos de Montúfar and Bishop José Cuero y Caicedo.
It was to advance on the cities of Guaranda and Ambato in the central highlands, hoping to bring them into the independence movement, and cut all road communication between Quito and Guayaquil and Cuenca, forestalling any Royalist countermove from the north.
The division, under the command of Venezuelan colonels Luis Urdaneta and León de Febres-Cordero, ringleaders of the revolt in Guayaquil, advanced out of the coastal plain towards the highlands, and by November 7, was ready to march into the Andes mountains.
Field-Marshal Melchor Aymerich, acting President and supreme commander of Royalist forces in Quito, sent around 5,000 troops south under veteran Spanish colonel Francisco González to deal with the 2,000-man patriot army in Ambato.
Severely defeated in the Battle of Huachi on November 22, 1820, Urdaneta's force fell back, badly mauled, to Babahoyo on the coastal plains.
As the Royalist army did not seem inclined to come down to the plains to meet them, the patriots sent guerrilla bands into the highlands, which were ambushed and massacred January 4 1821, at the Battle of Tanizagua.
The guerrillas' commanding officer, Spanish-born colonel Gabriel García Gomez, taken prisoner, was executed by firing squad and decapitated, with his head sent to Quito to be displayed to the population.
Aymerich acted to preempt him with a pincer movement: he would led his army from Guaranda down to Babahoyo, while Colonel González, came from the southern highlands down to Yaguachi to attack Sucre's flank.
His goal was to open the land route between Bogotá and Quito, by conquering the fiercely Royalist region around San Juan de Pasto.
A first rebellion under command of Benito Remigio Boves between october and December 1822, ended with the Navidad Negra massacre in San Juan de Pasto.