The Captaincy General of Puerto Rico () was an administrative district of the Spanish Empire, created in 1580 to provide better military management of the island of Puerto Rico, previously under the direct rule of a lone governor and the jurisdiction of Audiencia of Santo Domingo. Its creation was part of the, ultimately futile, Habsburg attempt in the late 16th century to prevent incursion into the Caribbean by foreign powers. Spain also established Captaincies General in Cuba, Guatemala and Yucatán. The Captaincy General played a crucial role in the history of the Spanish Caribbean. The institution lasted until 1898 in Puerto Rico, when an autonomous local government, headed by a governor-general and an insular parliament, was instituted just months before Spain ceded Puerto Rico to the United States in 1898 following defeat in the Spanish–American War. History Antecedents In 1508 Juan Ponce de León was commissioned by the Crown to carry out the initial colonization of Puerto Rico. After successfully founding the city of Caparra (on the site of today's Guaynabo), he was appointed as its first governor in 1509 by the regent of Castile, Ferdinand V. Since Christopher Columbus's death in 1506, the Spanish Crown had refused to recognize his heirs' right to appoint governors of the West Indies, but in 1511 the Council of Castile ruled in Diego Colón's favor. As a result, Ponce de León lost his position and left the island, not wishing to serve under Colón. The Columbus family appointed governors in Puerto Rico from then until 1536, when Diego's son, Luis Colón sold the rights to govern the Indies to the Crown. In 1511, when Diego Colón had won the right to appoint governors, the first diocese was established on the island under the auspices of the Archdiocese of Seville. (This diocese was later transferred in 1546 to oversight by the newly elevated Archdiocese of Santo Domingo. The Puerto Rico Diocese also supervised the church activities in the Province of Guayana in Venezuela from the 16th to 18th centuries.) From 1536 to 1545, the island was overseen by the president of the Audiencia of Santo Domingo, who was also Captain General of the Caribbean. The island territory was administered locally, not as one unit, but by the alcaldes ordinarios of the two municipalities of the island, San Juan (a reconstituted Caparra) and San Germán. These men were elected annually by the cabildos from among