Spain in the 17th century 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
Lê dynasty system, including the civil service and laws. Their long-lasting rule was attributed to the popularity of the early emperors. Lê Lợi's liberation of the country from 20 years of Ming rule and Lê Thánh Tông's bringing the country into a golden age was well-remembered by the people. Even when restored Lê emperors' rule was marked by civil strife and constant peasant uprisings, few dared to openly challenge their power, at least in name, for fear of losing popular support. When the Mạc dynasty tried to do so, they were not successful and were considered as usurpers and not recorded in