<P> The history of the Philippines is believed to have begun with the arrival of the first humans using rafts or boats at least 67,000 years ago as the 2007 discovery of Callao Man suggested . Negrito groups first inhabited the isles . Groups of Austronesians later migrated to the islands . </P> <P> Eventually various groups developed, separated into hunter - gatherer groups, warrior societies, petty plutocracies and maritime - oriented harbor principalities which eventually grew into kingdoms, rajahnates, kedatuans, wangdoms and sultanates . These small nations were either greatly influenced by the Indian Hindu religion, language, culture, literature and philosophy from India through many campaigns from India including the South - East Asia campaign of Rajendra Chola I, Islam from Arabia or were Sinified tributary states allied to China . The nations included the Indianized Rajahnates of Butuan and Cebu, the dynasty of Tondo, the kingdoms of Namayan and Maynila, the Kedatuans of Madja - as and Dapitan, the nation of Ma - i, the sinified Wangdom of Pangasinan, as well as the sultanates of Sulu, Lanao and Maguindanao . These small maritime states flourished from the 1st millennium . These kingdoms traded with what are now called China, India, Japan, Thailand, Vietnam, and Indonesia . The remainder of the settlements were independent barangays allied with one of the larger states . </P> <P> The first recorded visit by Europeans is the arrival of Ferdinand Magellan . He sighted Samar Island on March 16, 1521 and landed the next day on Homonhon Island, now part of Guiuan, Eastern Samar . Spanish colonization began with the arrival of Miguel López de Legazpi's expedition on February 13, 1565 from Mexico . He established the first permanent settlement in Cebu . Much of the archipelago came under Spanish rule, creating the first unified political structure known as the Philippines . Spanish colonial rule saw the introduction of Christianity, the code of law and the oldest modern university in Asia . The Philippines was ruled under the Mexico - based Viceroyalty of New Spain until Mexican independence . After which, the colony was directly governed by Spain . </P> <P> Spanish rule ended in 1898 with Spain's defeat in the Spanish--American War . The Philippines then became a territory of the United States . </P>

Who came first as permanent settlers in the philippines