 The Philippine Islands are named after King Philip II of Spain and it became a territory of the Viceroyalty of New Spain which was governed from Mexico City until the 19th century, when Mexico obtained independence.From 1821, the Philippine Islands were ruled directly from Madrid, Spain.Spaniards are referred by Filipinos as "Kastila" (Castilian) named after the former Kingdom of Castile, now a region of Spain.