 Most of the other Spanish-ruled areas of the Americas had also rebelled against their colonial masters.In 1821, the Philippine Islands were administered directly from Madrid, rather than via the Viceroy of Mexico, since Mexico and its southern neighbours had won their independence from Spain.The Spanish Empire sought to end the "Moro threat".