Answer
The War of the Spanish Succession lasted for 13 years, from 1701 to 1714. It was a conflict between the Habsburgs and the Bourbons over who would succeed the childless King Charles II of Spain. The war ended with the Treaty of Utrecht, which recognized Philip V of Spain as the new king and gave the British control of Gibraltar and Minorca.