In 1704, Anglo-Dutch forces captured Gibraltar from Spain during the War of the Spanish Succession on behalf of the Habsburg claim to the Spanish throne. The territory was ceded to Great Britain in perpetuity under the Treaty of Utrecht in 1713. During the Napoleonic Wars and World War II it was an important base for the Royal Navy as it controlled the entrance and exit to the Mediterranean Sea, the Strait of Gibraltar, which is only wide at this naval choke point. It remains strategically important, with half the world's seaborne trade passing through the strait. Today Gibraltar's economy is based largely on tourism, online gambling, financial services and bunkering.