The Royal Governor-General of the Philippines ruled the Spanish colony that is today the Republic of the Philippines except a two-year British occupation of Manila. This territory was also called the Captaincy-General of the Philippines and thus the governor also held the title of Captain General, a military rank conferred by the Spanish Cortes Generales. The men that held this position governed the Philippines and the rest of the Spanish East Indies from 1565 to 1821, on behalf of the Viceroyalty of New Spain.