The history of Spain dates back to the Middle Ages. In 1516, Habsburg Spain unified a number of disparate predecessor kingdoms; its modern form of a constitutional monarchy was introduced in 1813, and the current democratic constitution dates to 1978.
After the completion of the Reconquista, the Crown of Castile began to explore across the Atlantic Ocean in 1492, expanding into the New World and marking the beginning of the Golden Age under the Spanish Empire. The kingdoms of Spain were united under Habsburg rule in 1516, that unified the Crown of Castile, the Crown of Aragon and smaller kingdoms under the same rule. Until the 1650s, Habsburg Spain was among the most powerful states in the world.
During this period, Spain was involved in all major European wars, including the Italian Wars, the Eighty Years' War, the Thirty Years' War, and the Franco-Spanish War. In the later 17th century, however, Spanish power began to decline, and after the death of the last Habsburg ruler, the War of the Spanish Succession ended with the relegation of Spain, now under Bourbon rule, to the status of a second-rate power with a reduced influence in European affairs. The so-called Bourbon Reforms attempted the renewal of state institutions, with some success, but as the century ended, instability set in with the French Revolution and the Peninsular War, so that Spain never regained its former strength.