The costs of a huge army and an expansionary foreign policy led to revolts and political crises in Spain as well as France. In the sixteenth century, Spain was the wealthiest and most powerful country in Europe, conquering Portugal in 1580 and ruling an empire that stretched around the world. Gold and silver from New World mines poured into Spain, and Spanish oil, wine, and wool were exported to the colonies. Serious problems were already in evidence by the end of the century, however. Spanish armies had not been able to quash the revolt in the Netherlands, and in 1609 Philip III (ruled 1598–1622) recognized the independence of the northern part of the Netherlands as the United Provinces. Dutch and English ships took over much of the trade with the Spanish colonies, and Spanish attempts to prohibit this were futile. Central and South American mines gradually produced less metal, and the Indians and Africans forced to work in them died of disease and malnutrition. Royal expenses continued to increase, so much so that the crown declared bankruptcy fi ve times between 1590 and 1680. Declaring bankruptcy cancelled debts in the short term, but only heightened the crisis, as new loans to keep the government afl oat could only be secured at higher and higher rates of interest, thus transferring more wealth to the bankers and merchants (many of them outside Spain) who were willing to risk loaning money to the government. Like the old French nobility, Spanish aristocrats disdained commercial ventures as vulgar and lived off the rents of their lands. Their hostility to change and devotion to past military glories were stronger than those of nobles elsewhere, however, largely preventing the ennobling of new families through service as judges or offi - cials. Though wealthy commoners could increasingly buy noble titles, they expected after doing so to live off rents, not hold a legal or government position that would require actual work. The exclusivity of the nobility was further enhanced by the obsession with “purity of the blood” – having no Muslim or Jewish ancestors – for converts included the sort of well-educated urban professionals that in other parts of Europe were becoming state bureaucrats and royal administrators. In 1609 to 1611, over 200,000 Muslims and Muslim converts were expelled to North Africa, further reducing a population that had already declined signifi cantly because of famine and epidemic disease. Spanish nobles saw no way other than raising rents to increase their income and pay for imported luxuries, but this came at the same time as the government was increasing taxes; the peasants often had no surplus to sell and could not pay, abandoning their lands and drifting into cities or becoming vagabonds. The middle class was tiny, and there was little support for programs to develop industry or improve agricultural productivity. The Spanish nobility did back the crown in its military ventures, but these only brought further debt. Spain entered the Thirty Years War on the side of its Habsburg cousins, which allowed Portugal to revolt against Spanish rule in 1640 and regain its independence. The northern Spanish province of Catalonia revolted the same year, a war that dragged on for fi fteen years, though ultimately Spain recovered the province. Spain and France continued fi ghting after the Peace of Westphalia, with Spain eventually compelled to give up large territories to France. In recent years, historians have emphasized that the decline of Spain from its sixteenth-century heights of power was not as uniform as earlier historians had held. Philip III was long criticized for ruling through royal favorites and offi cials, but this may have represented his recognition of the realities of governing a huge and far-fl ung empire, rather than being simply a sign of weakness or incompetence. The establishment of the Bourbon dynasty with Philip V (ruled 1700–46) did lead Spain to become a fully unifi ed country, with its capital in Madrid. In the middle of the eighteenth century Charles III (ruled 1759–88) began a few programs of reform, which stabilized the economy somewhat and reduced government debt. Population and industry grew, especially in rural areas away from the capital. These measures were opposed by the nobility and the church, however, and this opposition combined with further involvement in wars abroad meant that government fi nances remained chaotic. Portugal was under Spanish Habsburg rule from 1580 to 1640, when opposition led to the proclamation of an independent Portuguese monarchy under John IV (ruled 1640–56). He left several sons, the younger of whom, at nineteen, ousted his older brother in a coup, ruling as regent until the older brother died in prison, when he took over offi cially as Peter II (ruled 1683–1706). Because of the rather questionable way he had come to the throne, Peter shared power with the high nobles, whose support he needed; he also made strategic marriage alliances with many of Europe’s ruling houses. Portugal became involved in the War of the Spanish Succession, during which parts of the country were left in ruins, but otherwise largely stayed out of international confl icts. During the long reigns of John V (ruled 1706–50) and Joseph I (ruled 1750–77), Portugal benefi ted from gold fl owing in from Brazil. The kings built churches and palaces in imitation of Louis XIV, and brought in a series of reforming ministers. After the city of Lisbon was devastated by an earthquake in 1755, the most dynamic of those ministers, Sebastião José de Carvalho e Melo (1699–1782), usually known as the marquis de Pombal, consolidated his power in the interests of centralized control and sounder economic policies. He limited the independent power of the nobility and greatly reduced the power of the church in both Portugal itself and its empire. Pombal dramatically shrank the Inquisition, and in 1759, under his direction, Portugal and its colonies expelled the Jesuits, accusing them of political intrigue.