Habsburg Spain at the beginning of the 17th century of Spain stood at the end of its Golden Age, and although it retained its vast empire, Spain had experienced severe difficulties in the later 16th century, including military defeats in Europe like the Spanish Armada and a series of financial crises that had caused the Spanish Crown to declare bankruptcy four times in the late 1500s (1557, 1560, 1576, 1596). Many different factors, including the decentralized political nature of Spain, inefficient taxation, a succession of weak kings, power struggles in the Spanish court and a tendency to focus on the American colonies instead of Spain's domestic economy, all contributed to the decline of the Habsburg rule of Spain.
The end of the 17th century also brought the end of Habsburg rule. The 18th century began with the War of the Spanish Succession, which concluded in the establishment of the Bourbon dynasty in Spain.
In 1469, Ferdinand II of Aragon and Isabella I of Castile united the Crowns of Aragon and Castile into one, creating the early modern Spanish state. Although this ensured future Spanish rulers would rule over both Aragon and Castile, both regions had their own administration and legal systems. In addition, Aragon itself was divided into Aragon proper, Valencia, and Catalonia - each with its own institutions, customs, and regional identity. As Ferdinand and Isabella both outlived their only son to survive infancy, they were succeeded by their grandson, Charles I upon Ferdinand's death in 1516. Being Flemish born and not a native Spanish speaker, Charles never completely assimilated into Spanish society and as Holy Roman Emperor, had to rule over two empires at once. Determining it to be too difficult for one person to rule over all of his domains, Charles gave the Holy Roman Empire to his younger brother and the Spanish Empire to son, Philip II.
Although the Spanish Empire was at the height of its power under Philip II, a number of factors foreshadowed its eventual decline. There was a revolt in the Netherlands which started in 1568 and lasted the rest of Philip's reign. Also, the moriscos in Andalusia rebelled in 1570 against Philip's imposition of Spanish language and customs on them. Philip was at war with England during the last 10 years of his reign. These wars and other difficulties of maintaining the vast Spanish Empire led to four bankruptcies during Philip's reign.