Spanish Filipino territories, together with the Spanish West Indies, were administered through the Viceroyalty of New Spain based in Mexico City. The Captaincy General of the Philippines (; ) was an administrative district of the Spanish Empire. The Captaincy General encompassed the Spanish East Indies which included the modern country of the Philippines and various Pacific Island possessions, such as the Caroline Islands and Guam. It was founded in 1565 with the first permanent Spanish settlements. For centuries all the political and economic aspects of the Captaincy were administered in Mexico by the Viceroyalty of New Spain, while the administrative issues had
Spanish East Indies of Luzon remained outside Spanish control until the early 19th century, and the southernmost tip of Palawan, not until the late 1890s. The rest of Mindanao (Caesarea Karoli)—aside from outposts in Northern Mindanao, Zamboanga, Cotabato, and the islands of Basilan and Jolo, the rest was nominally under Spanish control, recognizing Spanish rule, but left to administer their own affairs, as in the cases of the Sulu, and the Maguindanao sultanates, as well as a number of other Lumad tribes not affiliated with either. Similarly, Palau and the vast majority of the Caroline Islands were not governed by Spanish missions until