The Spanish established a centralized colonial government in the Philippines from 1565-1898. The political structure consisted of a national government ruled by a Governor General appointed by the King of Spain. Local governments administered provinces, cities, towns, and municipalities. This included alcaldias governed by Alcalde Mayors, corregimientos led by Corregidors, and municipal governments or ayuntamientos with cabildos. Barrios were governed by Cabezas de Barangay at the lowest level. This system aimed to maintain control over the islands and collect taxes for Spain.