In the years leading up to 1000 AD, there were already several maritime societies existing in the islands but there was no unifying political state encompassing the entire Philippine archipelago. Instead, the region was dotted by numerous semi-autonomous "barangays" (settlements ranging is size from villages to city-states) under the sovereignty of competing thalassocracies ruled by datus, rajahs or sultans or by upland agricultural societies ruled by "petty plutocrats". States such as the Wangdoms of Ma-i and Pangasinan, Kingdom of Maynila, Namayan, the Kingdom of Tondo, the Kedatuans of Madja-as, and Dapitan, the Rajahnates of Butuan and Cebu and the sultanates of Maguindanao, Lanao and Sulu existed alongside the highland societies of the Ifugao and Mangyan. Some of these regions were part of the Malayan empires of Srivijaya, Majapahit and Brunei.