<P> In 1521, Portuguese explorer Ferdinand Magellan's expedition arrived in the Philippines, claimed the islands for Spain and was then killed at the Battle of Mactan . Colonization began when Spanish explorer Miguel López de Legazpi arrived from Mexico in 1565 and formed the first Hispanic settlements in Cebu . After relocating to Panay island and consolidating a coalition of native Visayan allies, Hispanic soldiers and Latin - American recruits, the Spaniards then invaded Islamic Manila, therein they put down the Tondo Conspiracy and exiled the conspirators to Guam and Guerrero . Under Spanish rule, they established Manila as the capital of the Spanish East Indies (1571). </P> <P> They also defeated the Chinese warlord Limahong . To counteract the Islamization of the Philippines, the Spanish then conducted the Castilian War which was aimed against the Sultanate of Brunei and war was also waged against the Sultanate of Ternate and Tidore (in response to Ternatean slaving and piracy against Spain's allies: Bohol and Butuan). The Spanish considered their war with the Muslims in Southeast Asia an extension of the Reconquista, a centuries - long campaign to retake and rechristianize the Spanish homeland which was invaded by the Muslims of the Umayyad Caliphate . The Spanish expeditions into the Philippines were also part of a larger Ibero - Islamic world conflict that included a rivalry with the Ottoman Caliphate which had a center of operations at its nearby vassal, the Sultanate of Aceh . Consequently, fortifications were also set up in Taiwan and the Maluku islands . These were abandoned and the Spanish soldiers, along with the newly Christianized Papuan natives of the Moluccas, withdrew back to the Philippines in order to re-concentrate their military forces because of a threatened invasion by the Japan - born Ming - dynasty loyalist, Koxinga, ruler of the Kingdom of Tungning . However, the planned invasion was aborted . Meanwhile, settlers were sent to the Pacific islands of Palau and the Marianas . </P> <P> Spanish rule eventually contributed significantly to bringing political unity to the fragmented states of the archipelago . From 1565 to 1821, the Philippines was governed as a territory of the Mexico - based Viceroyalty of New Spain and then was administered directly from Madrid after the Mexican War of Independence . The Manila galleons, the largest wooden ships ever built, were constructed in Bicol and Cavite . The Manila galleons were accompanied with a large naval escort as it traveled to and from Manila and Acapulco . The galleons sailed once or twice a year, between the 16th and 19th centuries . The Manila Galleons brought with them goods, settlers and military reinforcements destined for the Philippines, from Latin America . </P> <P> Trade introduced foodstuffs such as maize, tomatoes, potatoes, chili peppers, chocolate and pineapples from Mexico and Peru . Within the Philippines, the Marquisate of Buglas was established and the rule of it was awarded to Sebastian Elcano and his crew, the survivors of the first circumnavigation of the world, as well as his descendants . New towns were also created and Catholic missionaries converted most of the lowland inhabitants to Christianity . They also founded schools, a university, hospitals and churches which were built along the Earthquake Baroque architectural style . To defend their settlements, the Spaniards constructed and manned a network of military fortresses (called "Presidios") across the archipelago . The Spanish also decreed the introduction of free public schooling in 1863 . As a result of these policies the Philippine population increased exponentially . </P>

Exact location of the philippines in the globe