The Kingdom of Spain (Spanish: Reino de España) entered a new era with the death of Charles II, the last Spanish Habsburg monarch, who died childless in 1700. The War of the Spanish Succession (1701-1714) was a European war fought between the proponents of the French Bourbon prince, Philip of Anjou, and the proponents of the Austrian Habsburg claimant, Archduke Charles. After the war ended with the Peace of Utrecht, the Prince of Anjou ruled as Philip V of Spain from 1715, although the peace treaty required he had to renounce his place in the succession of the French throne.
Spain entered a period of reform. Ideas of the Age of Enlightenment entered Spain and Spanish America. The period ended with the invasion of the Iberian Peninsula by Napoleon Bonaparte in the Peninsular War (1808-1814), which upended the stability of the Spanish Empire, and although France was defeated, the turmoil in Spain led to the Spanish American wars of independence of 1808 to 1833, in which most of the empire was lost.