Britain received Gibraltar from Spain after the War of the Spanish Succession, which was fought over who would succeed the childless King Charles II of Spain. Philip V succeeded Carlos II as King of Spain but had to renounce claims to the French throne under the Treaty of Utrecht, which ended the war. The war led Spain to financial ruin and total bankruptcy.