muslim missionaries arrived in tawi-tawi in 1380 and started the colonization of the area and the conversion of the native population to islam. in 1457, the sultanate of sulu was founded, and not long after that, the sultanates of maguindanao and buayan were also established. many indigenous lumad communities were displaced as a result of some of the area's 'islamization'. at the time when most of the philippines was under spanish rule, these sultanates maintained their independence and regularly challenged spanish domination of the philippines by conducting raids on spanish coastal towns in the north and repulsing repeated spanish incursions in their territory. it was not until the last quarter of the 19th century that the sultanate of sulu formally recognized spanish suzerainty, but these areas remained loosely controlled by the spanish as their sovereignty was limited to military stations and garrisons and pockets of civilian settlements in zamboanga and cotabato, until they had to abandon the region as a consequence of their defeat in the spanish–american war.