Spanish–Moro conflict
The Spanish initiated the conflict by conquering the Philippines and invading Moro territory in an effort to subjugate the region to their rule since the 1500s. When the Spanish conquered the Muslim Kingdom of Maynila, a vassal of the Sultanate of Brunei, the Islamic rajah, Rajah Sulayman resisted the Spanish. Manila then became the capital of the Spanish Philippines after the conquest, with the Spanish forcibly converting people to Catholicism. The Spanish–Moro Wars started with the Castille War, a war between Spaniards and the Sultanate of Brunei. (The term "Moro" at this time included Muslim Tagalogs who were ruled by the Sultanate of Brunei).
History of Spanish slavery in the Philippines
When Spaniards conquered the archipelago, the Laws of the Indies served as a compilation of royal decrees for the Spanish colonies including the Philippines. This included a law stating that Spaniards were forbidden to hold Filipinos as slaves since they were under the subjection of King Phillip II. Observing the widespread practice of slavery among the native tribes, the Law was sometimes ignored by soldiers, some acting on their own and seizing natives in various parts of the country. Governor-General Legazpi, upon discovering this, freed the slaves and punished those who took them under the jurisdiction of the monarchy.