By the time the revolution began in August 1896, Cavite was one of the first provinces in the Philippines to declare independence from Spain. Earlier in the war, the Filipino revolutionaries under the "Supremo" Andres Bonifacio, the leader and the instigator of the revolution, attempted to invest then take Manila by force, but was stymied by severe lack of decent weapons in their part as well as the reluctance of other revolutionary provincial armies, especially the ones from Cavite which also had difficulty in mounting such an attack then rather attacked local Spanish garrisons in the province, from taking part of the engagement. The "Supremo" Bonifacio had been repeatedly defeated in battle, losing his prestige as well as the morale of some men who were serving at his side, especially those who were from Bulacan and Morong provinces. In contrast, the revolutionaries in the province had been largely successful in battles from the start of the revolution against the Spaniards, though outnumbered. Spanish general Ernesto de Aguirre was killed more than two months earlier during the Battle of Imus in September 1896, and had been defeated by the rebels, including generals Emilio Aguinaldo of the Magdalo faction and Santiago Alvarez of the Magdiwang faction. The former successfully led a small uprising in Cavite el Viejo on August 31, 1896, where he defeated and killed the Spanish commander of the "Guardia Civil", after Bonifacio's defeat at the Battle of San Juan del Monte. The leadership was then passed from his cousin, Baldomero, to him, where most of "Magdalo" members and revolutionaries regarded him as their leader.