The Spanish colonization of the Philippines lasted for more than three centuries. The revolution against Spain began in 1896, culminating in the establishment of the First Philippine Republic. However, the Treaty of Paris, signed in 1898 at the end of the Spanish-American War, transferred control of the Philippines to the United States. The First Philippine Republic did not recognize this agreement and started the Philippine-American War in 1899. Philippine president Emilio Aguinaldo was captured in 1901, and the US government declared the conflict officially over in 1902. Commonwealth status was granted in 1935. The Treaty of Manila in 1946 finally established the Philippine Republic as an independent nation.