In the subsequent War of the Spanish Succession ( 1702 1713 ) most of the old kingdom of Arag ? ? n , including the Balearics , backed the Hapsburgs .
Spain has been united and independent for 500 years .