Ferdinand Magellan arrived in the Philippines in 1521, claiming the lands for Spain and converting some locals to Catholicism. However, Lapu-Lapu resisted Spanish colonization, killing Magellan in 1521. Over the following centuries, the Spanish established control over the islands and introduced Christianity, but faced numerous uprisings from native groups seeking independence. This period of Spanish rule lasted until 1898, when Spain ceded the Philippines to the United States following the Spanish-American War.