On January 21, 1899, the First Philippine Republic had been proclaimed with Aguinaldo as president, replacing Aguinaldo's revolutionary government. On June 2, 1899, the First Philippine Republic declared war against the United States, marking the official beginning of the Philippine–American war.