The Spanish Empire was one of the largest empires in history and one of the first global empires.
In the 15th and 16th centuries, Spain was in the vanguard of European global exploration and colonial expansion. Spain opened trade routes across the oceans, with trade flourishing across the Atlantic Ocean between Spain and America and across the Pacific Ocean between Asia-Pacific and Mexico via the Philippines. Conquistadors toppled the Aztec, Inca, and Maya civilizations, and laid claim to vast stretches of land in North and South America. For a time, the Spanish Empire was the foremost global power, dominating the oceans with its experienced navy and ruling the European battlefield with its infantry tercios. Spain enjoyed a cultural golden age in the 16th and 17th centuries.
From the middle of the 16th century, silver and gold from American mines increasingly financed the military capability of Habsburg Spain in its long series of European and North African wars. In the 17th and 18th centuries, the Spanish empire maintained the largest territory in the world, although it suffered fluctuating military and economic fortunes from the 1640s. Confronted by the new experiences, difficulties and suffering created by empire-building, Spanish thinkers formulated some of the first modern ideas on natural law, sovereignty, international law, war, and economics — even questioning the legitimacy of imperialism — in related schools of thought called the School of Salamanca.
Constant contention with rival powers caused territorial, commercial, and religious conflict that contributed to the slow decline of Spanish power from the mid-17th century. In the Mediterranean, Spain warred constantly with the Ottoman Empire; on the European continent, France became comparably strong. Overseas, Spain was initially rivaled by Portugal, and later by the English and Dutch. In addition, English-, French-, and Dutch-sponsored piracy, overextension of Spanish military commitments in its territories, increasing government corruption, and economic stagnation caused by military expenditures ultimately contributed to the empire's weakening.
Spain's European empire was finally undone by the Peace of Utrecht (1713), which stripped Spain of its remaining territories in Italy and the Low Countries. Spain's fortunes improved thereafter, but it remained a second rate power in continental European politics.
However, Spain maintained and enlarged its vast overseas empire until the 19th century, when the shock of the Peninsular War sparked declarations of independence in Quito (1809), Colombia (1810), Venezuela and Paraguay (1811) and successive revolutions that split away its territories on the mainland (the Spanish Main) of America. Spain retained significant fragments of its empire in the Caribbean (Cuba and Puerto Rico); Asia (Philippines), and Oceania (Guam, Micronesia, Palau, and Northern Marianas) until the Spanish–American War of 1898. Spanish participation in the Scramble for Africa was minimal: Spanish Morocco was held until 1956 and Spanish Guinea and the Spanish Sahara were held until 1968 and 1975 respectively. The Canary Islands, Ceuta, Melilla are administrative divisions that have remained part of Spain and, Isla de Alborán, Isla Perejil, Islas Chafarinas, Peñón de Alhucemas, and Peñón de Vélez de la Gomera are territories which have remained part of Spain. Also, according to the UN "Spanish Sahara/Western Sahara," annexed by Morocco in 1976, is still technically under Spanish Administration.