<P> The structure of governance of its overseas empire was significantly reformed in the late 18th century by the Bourbon monarchs . Although the crown attempted to keep its empire a closed economic system under Hapsburg rule, Spain was unable to supply the Indies with sufficient consumer goods to meet demand, so that foreign merchants from Genoa, France, England, Germany, and The Netherlands dominated the trade, with silver from the mines of Peru and Mexico flowing to other parts of Europe . The merchant guild of Seville (later Cadiz) served as middlemen in the trade . The crown's trade monopoly was broken early in the seventeenth century, with the crown colluding with the merchant guild for fiscal reasons in circumventing the supposedly closed system . Spain was unable to defend the territories it claimed in the Americas, with the Dutch, the English, and the French taking Caribbean islands, using them to engage in contraband trade with the Spanish populace in the Indies . In the seventeenth century, the diversion of silver revenue to pay for European consumer goods and the rising costs of defense of its empire meant that "tangible benefits of America to Spain were dwindling...at a moment when the costs of empire were climbing sharply ." </P> <P> The Bourbon monarchy attempted to expand the possibilities for trade within the empire, by allowing commerce between all ports in the empire, and took other measures to revive economic activity to the benefit of Spain . The Bourbons had inherited "an empire invaded by rivals, an economy shorn of manufactures, a crown deprived of revenue...(and tried to reverse the situation by) taxing colonists, tightening control, and fighting off foreigners . In the process, they gained a revenue and lost an empire ." The Napoleonic invasion of the Iberian peninsula precipitated the Spanish American wars of independence (1808 - 1826), resulting the loss of its most valuable colonies . In its former colonies in the Americas, Spanish is the dominant language and Catholicism the main religion, enduring cultural legacies of the Spanish Empire . </P> <P> With the marriage of the heirs apparent to their respective thrones Ferdinand of Aragon and Isabella of Castile created a personal union that most scholars view as the foundation of the Spanish monarchy . Their dynastic alliance was important for a number of reasons, ruling jointly over a large aggregation of territories although not in a unitary fashion . They successfully pursued expansion in Iberia in the Christian Reconquest of the Muslim Kingdom of Granada, completed in 1492, for which Valencia - born Pope Alexander VI gave them the title of the Catholic Monarchs . Ferdinand of Aragon was particularly concerned with expansion in France and Italy, as well as conquests in North Africa . </P> <P> With the Ottoman Turks controlling the choke points of the overland trade from Asia and the Middle East, both Spain and Portugal sought alternative routes . The Kingdom of Portugal had an advantage over the rest of Iberian, having earlier retaken territory from the Muslims . Portugal completed Christian reconquest in 1238 and settling the kingdom's boundaries . Portugal then began to seek further overseas expansion, first to the port of Ceuta (1415) and then by colonizing the Atlantic islands of Madeira (1418) and the Azores (1427 - 1452); it also began voyages down the west coast of Africa in the fifteenth century . Its rival Castile laid claim to the Canary Islands (1402) and retook territory from the Moors in 1462 . The Christian rivals, Castile and Portugal, came to formal agreements over the division of new territories in the Treaty of Alcaçovas (1479), as well as securing the crown of Castile for Isabella, whose accession was challenged militarily by Portugal . </P>

The most important factor in the rise of spain as a major european power was
find me the text answering this question