Colonization began when Spanish explorer Miguel López de Legazpi arrived from Mexico in 1565. In 1571, Spanish Manila became the capital of the Spanish East Indies, which encompassed Spanish territories in Asia and the Pacific. The Spanish successfully invaded the different local states by employing the principle of divide and conquer, bringing most of what is now the Philippines into a single unified administration. Disparate barangays were deliberately consolidated into towns, where Catholic missionaries were more easily able to convert the inhabitants to Christianity. From 1565 to 1821, the Philippines was governed as part of the Mexico-based Viceroyalty of New Spain, later administered from Madrid following the Mexican War of Independence. Manila was the western hub of the trans-Pacific trade. Manila galleons were constructed in Bicol and Cavite.