The War of the Spanish Succession was fought between European powers, including a divided Spain, over who had the right to succeed Charles II as King of Spain. This war resulted into the Treaty of Utrecht.
France and Castilla (under Philip) supported the Bourbons.
Holy Roman Empire:
Austria, Prussia, Hanover.
England, Scotland, Great Britain, Dutch of Savoy, Kingdom of Portugal, Spain loyal to Charles.
Supported the Hapsburg Empire.