During the Spanish-American War (1898), US forces partnered with local independence movements in both territories:
Filipino revolutionaries led by Emilio Aguinaldo had fought Spain since 1896. They initially allied with US forces (Dewey's fleet, then ground troops), declaring independence June 12, 1898. However, the US did not recognize Philippine independence, leading to the Philippine-American War (1899-1902) as former allies became adversaries.
Puerto Rican Autonomists led by Luis Muñoz Rivera sought self-government within the Spanish Empire. They welcomed US invasion as liberation from Spain, but Puerto Rico became a US territory—not independent. The Autonomist Party evolved into the Union Party, advocating for statehood or autonomy.
Both groups sought self-determination; both found US imperial ambitions replaced Spanish colonial rule. The Philippines gained independence in 1946; Puerto Rico remains a US territory with ongoing status debates.