Spanish East Indies exception of a short period at the end of the 18th century). In 1821 the New Spanish Viceroyalty collapsed following the Mexican War of Independence, which resulted in the First Mexican Empire. All control of the Spanish East Indies government was then transferred to Madrid, until the United States annexed most Spanish territories in the Asia-Pacific region after the Spanish–American War of 1898. In 1574 the Captaincy General of the Philippines was created as a dependency of the Viceroyalty of New Spain. The Real Audiencia of Manila was created on and established in 1584 as the highest tribunal of the
Royal Netherlands East Indies Army Bali was finally taken under full control with the Dutch intervention in Bali (1906) and the final Dutch intervention in Bali (1908). In the nineteenth and early twentieth centuries, the KNIL resumed the conquest of the Indonesian archipelago. After 1904 the Netherlands East Indies were considered pacified, with no large-scale armed opposition to Dutch rule until World War II, and the KNIL served a mainly defensive role protecting the Dutch East Indies from the possibility of foreign invasion. Once the archipelago was considered pacified the KNIL was mainly involved with military policing tasks. To ensure a sizeable European military segment