section_path: History/Early states (900–1565)
section_name: Early states (900–1565)
paragraph_text: Early states (900–1565)
  
  The earliest known surviving written record in the Philippines is the 900 AD Laguna Copperplate Inscription, which was written in Old Malay using the early Kawi script. By the 14th century, several large coastal settlements emerged as trading centers and became the focus of societal changes. Some polities had exchanges with other states throughout Asia.: 3 Trade with China began during the late Tang dynasty, and expanded during the Song dynasty. Throughout the second millennium AD, some polities were part of the tributary system of China.: 177–178 : 3 With extensive trade and diplomacy, this brought Southern Chinese merchants and migrants from Southern Fujian, who would gradually settle and intermix in the Philippines. Indian cultural traits such as linguistic terms and religious practices began to spread in the Philippines during the 14th century, via the Indianized Hindu Majapahit Empire. By the 15th century, Islam was established in the Sulu Archipelago and spread from there.
  
  Polities founded in the Philippines between the 10th and 16th centuries include Maynila, Tondo, Namayan, Pangasinan, Caboloan, Cebu, Butuan, Maguindanao, Lanao, Sulu, and Ma-i. The early polities typically had a three-tier social structure: nobility, freemen, and dependent debtor-bondsmen.: 3 : 672 Among the nobility were leaders known as datus, who were responsible for ruling autonomous groups (barangays or dulohan). When the barangays banded together to form a larger settlement or a geographically looser alliance,: 3 their more-esteemed members would be recognized as a " paramount datu ",: 58 rajah or sultan, and would rule the community. Population density is thought to have been low during the 14th to 16th centuries: 18 due to the frequency of typhoons and the Philippines' location on the Pacific Ring of Fire. Portuguese explorer Ferdinand Magellan arrived in 1521, claimed the islands for Spain, and was killed by Lapulapu 's men in the Battle of Mactan.: 21 : 261