The Philippines was discovered in 1521 by Portuguese explorer Ferdinand Magellan and colonized by Spain from 1565 to 1898. Following the Spanish–American War, it became a territory of the United States.