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).
Sovereignty of the Philippines
During Spain's 333 year rule in the Philippines, the colonists had to fight off the Chinese pirates (who lay siege to Manila, the most famous of which was Limahong in 1574), Dutch forces, and Portuguese forces. Moros from western Mindanao and the Sulu Archipelago constantly raided the coastal Christian areas of Luzon and the Visayas and occasionally brought home loot and fair women. They often sold their captives as slaves. A British conquest of the Spanish Philippines occurred during the Seven Years' War, with British occupation of the capital between 1762 and 1764. Also, there were a number of failed Philippine revolts during Spanish rule.