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 the Philippines (900–1521)
Prior to Spanish occupation, the islands were composed of different kingdoms, rajahnates and sultanates. Some are even part of a larger Empire outside of the modern day map of what is now the Philippines, for example; Manila was once part of the Bruneian Empire. Another example is many parts of the modern day Mindanao is theorized to be part of the Majapahit empire with its capital being located in East Java in the modern day Indonesia. It was the Spaniards that named the collection of Southeast Asian islands they conquered as Las Islas Filipinas, the geographical locations of which the modern day country of the Philippines based its territories today.