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).
Philippines
Trade introduced foodstuffs such as maize, tomatoes, potatoes, chili peppers, chocolate and pineapples from Mexico and Peru. Within the Philippines, the Marquisate of Buglas was established and the rule of it was awarded to Sebastian Elcano and his crew, the survivors of the first circumnavigation of the world, as well as his descendants. New towns were also created and Catholic missionaries converted most of the lowland inhabitants to Christianity. They also founded schools, a university, hospitals and churches which were built along the Earthquake Baroque architectural style. To defend their settlements, the Spaniards constructed and manned a network of military fortresses (called "Presidios") across the archipelago. The Spanish also decreed the introduction of free public schooling in 1863. Slavery was also abolished. As a result of these policies the Philippine population increased exponentially.
During its rule, Spain quelled various indigenous revolts. There were also several external military challenges from Chinese and Japanese pirates, the Dutch, the English, the Portuguese and the Muslims of Southeast Asia. Those challengers were fought off despite the hostile forces having encircled the Philippine archipelago in a crescent formed from Japan to Indonesia. The Philippines was maintained at a considerable cost during Spanish rule. The long war against the Dutch from the West, in the 17th century, together with the intermittent conflict with the Muslims in the South and combating Japanese-Chinese Wokou piracy from the North nearly bankrupted the colonial treasury. Furthermore, the state of near constant wars caused a high death and desertion rate among the Mestizo, Mulatto and Indio (Native American) soldiers sent from Mexico and Peru that were stationed in the Philippines. This left only the fittest and strongest to survive and serve out their military service. The high death and desertion rates also applied to the native Filipino warriors and laborers levied by Spain, to fight in battles all across the archipelago and elsewhere or build galleons and public works. The repeated wars, lack of wages, dislocation and near starvation were so intense, almost half of the soldiers sent from Latin America and the warriors and laborers recruited locally either died or fled to the lawless countryside to live as vagabonds among the rebellious natives, escaped enslaved Indians (From India) and Negrito nomads, where they race-mixed through rape or prostitution, which further blurred the racial caste system Spain tried so hard to maintain in the towns and cities. These circumstances contributed to the increasing difficulty of governing the Philippines. Due to these, the Royal Fiscal of Manila wrote a letter to King Charles III of Spain, in which he advises to abandon the colony, but this was successfully opposed by the religious and missionary orders that argued that the Philippines was a launching pad for further conversions in the Far East. The non-profitable Philippine colony survived on an annual subsidy paid by the Spanish Crown and often procured from taxes and profits accrued by the Viceroyalty of New Spain (Mexico), and the 200-year-old fortifications at Manila had not been improved much since first built by the early Spanish colonizers. This was one of the circumstances that made possible the brief British occupation of Manila.