The Spaniards colonized the Philippines as the Captaincy General of the Philippines. The Spanish monarchy was represented by the Governor-General from 1565 to 1898. Spain ceded all of its remaining possessions, including the Philippines, save for Cuba at the end of the Spanish–American War via the Treaty of Paris.