War of the Spanish Succession
The Spanish lost the kingdom to the Austrians during the War of the Spanish Succession.