After the death of the Spanish Habsburg King Charles II, the Spanish crown passed onto his successor Prince Philip of Anjou. The war would end in 1714 with the signing of the treaties of Utrecht, Rastatt and Baden.
eBay