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