 Meanwhile, coastal states were split among Hindu-Buddhist kingdoms, Muslim principalities, and ethnoreligious tribes, who had trading connections with Borneo, Java, Sumatra, Malaya, Indochina, Bengal, India, Korea, Okinawa, Japan and China, before the Spaniards established their rule.From just before the first millennium, the Tagalog, Kapampangan and Pangasinan peoples of south and central Luzon had established several major coastal polities, most notable among them those of Maynila, Tondo and Namayan.The Laguna Copperplate Inscription, the first Philippine document written in 900AD, names places in and around Manila Bay as well as Medan in Indonesia.