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 tribes first inhabited the isles. Groups of Austronesians later migrated to the islands.
Eventually various groups developed, separated into hunter-gatherer tribes, warrior societies, petty plutocracies and maritime-oriented harbor principalities which eventually grew into kingdoms, rajahnates, kedatuans, huangdoms 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 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 Kedatuan of Madja-as, the sinified Huangdom of Ma-i and Huangdom 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.
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.
Spanish rule ended in 1898 with Spain's defeat in the Spanish–American War. The Philippines then became a territory of the United States.
In the 21st century, the Philippines is the 12th most populous country of the world, part of ASEAN, a key ally of the United States, with an economy dominated by fishing and agriculture with a growing business process outsourcing (BPO) industry and nearly 10% of the population abroad as overseas Filipino workers.