The Philippine Revolution (Filipino: Himagsikang Pilipino or Rebolusyong Pilipino; Spanish: Revolución Filipina or Guerra Tagala) was a war of independence waged by the revolutionary organization Katipunan against the Spanish Empire from 1896 to 1898. It was the culmination of the 333-year colonial rule of Spain in the archipelago. The Philippines was one of the last major colonies of the Spanish Empire, which had already suffered a massive decline in the 1820s. Cuba rebelled in 1895, and in 1898, the United States intervened and the Spanish soon capitulated. In June, Philippine revolutionaries declared independence. However, it was not recognized by Spain, which sold the islands to the United States in the Treaty of Paris.
Led by Andrés Bonifacio, the Katipunan was formed in secrecy in 1892 in the wake of the nascent La Liga Filipina, an organization created by Filipino nationalist José Rizal and others in Spain with goals of Philippine representation to the Spanish Parliament. Katipunan soon gained influence across the islands, and sought an armed revolution. However, that revolution started prematurely in August 1896 upon its discovery by Spanish authorities in Manila. The organization soon declared war against Spain in Caloocan. Early battles and skirmishes were centered around sieging the capital city of Manila led by Bonifacio himself, which ultimately failed. However, revolutionaries in the neighboring provinces fared better, particularly in Cavite, where rebels led by Mariano Álvarez and cousins Baldomero and Emilio Aguinaldo won early major victories. This disparity in success, along with multiple factors, contributed to the eventual power struggle from within Katipunan's leadership. Two factions formed: Bonifacio's Magdiwang and Aguinaldo's Magdalo. This struggle culminated in the 1897 elections in Tejeros, which saw Emilio Aguinaldo elected as president in absentia. Bonifacio nullified the results after a Magdalo member questioned his election as the Secretary of the Interior. This resulted in a schism, with Bonifacio's supporters alleging that the elections were fraudulent, with Bonifacio himself refusing to recognize the results. In April 1897, Aguinaldo ordered the arrest of Bonifacio. A trial was set in Maragondon, where the Magdalo-led jury found Bonifacio and his brother Procopio guilty of treason, sentencing both of them to death. Despite calls for commuting the sentence for the sake of national unity, the brothers were executed in May 1897. Later that year, Aguinaldo's government and Spanish authorities signed the Pact of Biak-na-Bato, which temporarily reduced hostilities. Filipino revolutionary officers exiled themselves to Hong Kong. However, the hostilities never completely ceased.