In 1896, the Philippine Revolution began against Spanish colonial rule. In 1897, Philippine forces led by Aguinaldo signed a ceasefire with the Spanish authorities and Aguinaldo and other leaders went into exile in Hong Kong. In April 1898, the Spanish–American War broke out. The U.S. Navy's Asiatic Squadron, then in Hong Kong, sailed to the Philippines to engage the Spanish naval forces. On May 1, 1898, the U.S. Navy decisively defeated the Spanish Navy in the Battle of Manila Bay. Later in May, Aguinaldo returned to the Philippines, established a dictatorial government on May 24, 1898 (formally established by decree on June 18), and on June 12, 1898, at Aguinaldo's ancestral home in Cavite, issued the Philippine Declaration of Independence from Spain. Following the proclamation of independence Aguinaldo established a revolutionary government on June 23, 1898, under which the partly-elected and partly-appointed Malolos Congress convened on 15 September to write a constitution.
On December 10, 1898, the 1898 Treaty of Paris was signed, ending the Spanish–American War and transferring the Philippines from Spain to the United States.
The Malolos Constitution written by the congress was proclaimed on 22 January 1899, creating what is known today as the First Philippine Republic, with Aguinaldo as its president. The constitution was approved by delegates to the Malolos Congress on January 20, 1899, and sanctioned by Aguinaldo the next day. The convention had earlier elected Aguinaldo president on January 1, 1899, leading to his inauguration on January 23. Parts of the constitution gave Aguinaldo the power to rule by decree.[Note 3] The constitution was titled "Constitución política", and was written in Spanish.
When the First Philippine Republic was constituted on January 22, 1899 in Malolos, that municipality became the seat of government of the Philippine Republic, and was serving as such when hostilities erupted between U.S. and Filipino forces in the Second Battle of Manila on February 4. On February 4, 1899, armed conflict erupted in Manila between Philippine Republic forces and American forces occupying the city subsequent to the conclusion of the Spanish–American War. That day President Aguinaldo issued a proclamation ordering and commanding that "peace and friendly relations with the Americans be broken and that the latter be treated as enemies, within the limits prescribed by the laws of war." The fighting quickly escalated into the Second Battle of Manila, with Philippine Republic forces being driven out of the city.
American forces pushing north from Manila after the outbreak of fighting captured Caloocan on February 10. On March 29, as American forces threatened Malolos, the seat of government moved to San Isidro, Nueva Ecija. On March 31, American forces captured Malolos, the initial seat of the Philippine Republic government, which had been gutted by fires set by withdrawing Philippine Republic forces. Emilio Aguinaldo and the core of the revolutionary government had by then moved to San Isidro, Nueva Ecija. Peace negotiations with the American Schurman Commission during a brief ceasefire in April–May 1899 failed, and San Isidro fell to American forces on May 16. The Philippine Republic core government had moved by then to Bamban, Tarlac, and subsequently moved to Tarlac town. Aguinaldo's party had already left Tarlac, the last capital of the Philippine Republic, by the time American troops occupied it on November 13.
American forces captured Calumpit, Bulacan on April 27 and, moving north, captured Apalit, Pampanga with little opposition on May 4 and San Fernando, Pampanga on May 5. This forced the seat of government to be shifted according to the demands of the military situation.[Note 2]
In October 1899 American forces were in San Fernando, Pampanga and the Philippine Republic was headquartered not far north of there, in Angeles. On October 12, an American offensive to the north forced the Philippine Republic to relocate its headquarters in November to Tarlac, and then to Bayombong, Nueva Vizcaya. On November 13, under pressure by American forces, Aguinaldo and a party departed Bayombong by rail for Calasiao, Pangasinan, from where they immediately proceeded eastwards to Sta. Barbara in order to evade pursuing American forces. In Sta. Barbara, they joined a force of some 1200 armed men led by General Gregorio del Pilar.
On November 13, in a conference in Bayambang, Pangasinan, Aguinaldo decided to disperse his army and begin guerrilla war. From that point on, distance and the localistic nature of the fighting prevented him from exercising a strong influence on revolutionary or military operations. Recognizing that American troops blocked his escape east, he turned north and west on 15 November, crossing the mountains into La Union province. Aguinaldo's party eluded pursuing American forces, passing through Tirad Pass near Sagada, Mountain Province where the Battle of Tirad Pass was fought on December 2 as a rear guard action to delay the American advance and ensure his escape. At the time of the battle, Aguinaldo and his party were encamped in Cervantes, about 10 km south of the pass. After being notified by a rider of the outcome of the battle and the death of del Pilar, Aguinaldo ordered that camp be broken, and departed with his party for Cayan settlement. Aguinaldo was captured by American forces on March 23, 1901 in Palanan, Isabela. Following his capture, Aguinaldo announced allegiance to the United States on April 1, 1901, formally ending the First Republic and recognizing the sovereignty of the United States over the Philippines.
Aguinaldo's party, traveling with del Pilar's force, reached Manaoag, Pangasinan on November 15. There, the force was split into vanguard and rear guard elements, with Aguinaldo and del Pilar in the vanguard. The vanguard force overnighted in Tubao, La Union, departed there on November 16, and was in Naguilian, La Union by November 19, where word was received that American forces had taken Santo Tomas and had proceeded to Aringay. Aguinaldo's force arrived in Balaoan, La Union on November 19, pushed on the next day, and arrived at the Tirad Pass, a natural choke point, on November 23. General del Pilar decided to place a blocking force in Tirad Pass to delay pursuing American forces while Aguinaldo's party moved on.
The Battle of Tirad Pass took place on December 2, 1899. 52 men of del Pilar's 60-man force were killed, including del Pilar himself. However, the Filipinos under del Pilar held off the Americans long enough for Aguinaldo's party to escape. Aguinaldo, encamped with his party about 10 km south of the pass in Cervantes, Ilocos Sur, was apprised of the result of the battle by a rider, and moved on. The party reached Banane settlement on December 7, where Aguinaldo paused to consider plans for the future. On December 16, the party departed for Abra to join forces with General Manuel Tinio. The party traveled on foot through a pass at the summit of Mount Polis, and arrived at Ambayuan the next morning. The party pushed on to Banane, pursued closely by American forces. At this point, Aguinaldo's party consisted of one field officer, 11 line officers, and 107 men. The remainder of December 1899 was spent in continuous trek.
The party was at the border of Abra and Cagayan provinces on Aguinaldo's 31st birthday on March 23, 1900. The trek from place to place continued until about May 22, 1900, when Aguinaldo established a new headquarters in Tierra Virgen. On August 27, 1900, after American forces landed at Aparri, Cagayan, Aguinaldo concluded that Tierra Virgan had become untenable as a headquarters and decided to march to Palanan, Isabela. On December 6, 1899, the party reached Dumasari, and arrived in Palanan the following morning. Aguinaldo remained in Palanan until his capture there by American forces with the aid of the native scouts on March 23, 1901.