Negritos, some of the archipelago's earliest inhabitants, were followed by successive waves of Austronesian peoples. Adoption of Animism, Hinduism and Islam established island-kingdoms called Kedatuans, Rajahnates and Sultanates. The arrival of Ferdinand Magellan, a Portuguese explorer leading a fleet for Spain, marked the beginning of Spanish colonization. In 1543, Spanish explorer Ruy López de Villalobos named the archipelago "" in honor of Philip II of Spain. Spanish settlement through Mexico, beginning in 1565, led to the Philippines becoming part of the Spanish Empire for more than 300 years. During this time, Catholicism became the dominant religion, and Manila became the western hub of trans-Pacific trade. In 1896, the Philippine Revolution began, which then became entwined with the 1898 Spanish–American War. Spain ceded the territory to the United States, while Filipino rebels declared the First Philippine Republic. The ensuing Philippine–American War ended with the United States establishing control over the territory, which they maintained until the Japanese invasion of the islands during World War II. Following liberation, the Philippines became independent in 1946. Since then, the unitary sovereign state has often had a tumultuous experience with democracy, which included the overthrow of a dictatorship by the People Power Revolution.