War of the Spanish Succession: Gibraltar is captured by an English and Dutch fleet, commanded by Admiral Sir George Rooke and allied with Archduke Charles.

Gibraltar ( jih-BRAWL-tr, Spanish: [xialta]) is a British Overseas Territory located at the southern tip of the Iberian Peninsula. It has an area of 6.7 km2 (2.6 sq mi) and is bordered to the north by Spain. The landscape is dominated by the Rock of Gibraltar, at the foot of which is a densely populated town area, home to over 32,000 people, primarily Gibraltarians.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 14.3 km (8.9 mi) 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.The sovereignty of Gibraltar is a point of contention in Anglo-Spanish relations, as Spain asserts a claim to the territory. Gibraltarians overwhelmingly rejected proposals for Spanish sovereignty in a 1967 referendum, and for shared sovereignty in a 2002 referendum. Nevertheless, Gibraltar maintains close economic and cultural links with Spain, with many Gibraltarians speaking Spanish as well as a local dialect known as Llanito.

On 31 January 2020, the UK and Gibraltar left the European Union. In December 2020, the UK and Spain agreed in principle to a basis on which the UK and the EU might negotiate terms for Gibraltar to participate in aspects of the Schengen Agreement to facilitate border movements.

The War of the Spanish Succession (1701–1715) was a conflict involving many of the leading European powers that was triggered by the death in November 1700 of the childless Charles II of Spain. It established the principle that dynastic rights were secondary to maintaining the balance of power between different countries. Related conflicts include the 1700–1721 Great Northern War, Rákóczi's War of Independence in Hungary, the Camisards revolt in southern France, Queen Anne's War in North America and minor struggles in colonial India.

Although weakened by over a century of continuous conflict, in 1700 the Spanish Empire remained a global power with its vast dominions including the Spanish Netherlands, large parts of Italy, the Philippines, and much of the Americas. Charles's closest heirs were members of the Austrian Habsburgs or French Bourbons; acquisition of an undivided Spanish Empire by either threatened the European balance of power.

Attempts by Louis XIV of France and William III of England to partition the empire in 1698 and 1700 were rejected by the Spanish. Instead, Charles named Philip of Anjou, a grandson of Louis XIV, as his heir; if he refused, the alternative was Archduke Charles, younger son of Leopold I, Holy Roman Emperor. Having accepted, Philip was proclaimed king of an undivided Spanish Empire on 16 November 1700. The proclamation led to war, with France and Spain on one side and the Grand Alliance on the other to maintain the separation of the Spanish and French thrones.

The French held the advantage in the early stages, but were forced onto the defensive after 1706; however, by 1710 the Allies had failed to make any significant progress, while Bourbon victories in Spain had secured Philip's position as king. When Emperor Joseph I died in 1711, Archduke Charles succeeded his brother as emperor, and the new British government initiated peace talks. Since only British subsidies kept their allies in the war, this resulted in the 1713–15 Peace of Utrecht treaties, followed by the 1714 Treaties of Rastatt and Baden.

Philip was confirmed as king of Spain in return for renouncing the right of himself or his descendants to inherit the French throne; the Spanish Empire remained largely intact, but ceded territories in Italy and the Low Countries to Austria and Savoy. Britain retained Gibraltar and Menorca which it captured during the war, acquired significant trade concessions in the Spanish Americas, and replaced the Dutch as the leading maritime and commercial European power. The Dutch gained a strengthened defence line in what was now the Austrian Netherlands; although they remained a major commercial power, the cost of the war permanently damaged their economy.

France withdrew backing for the exiled Jacobites and recognised the Hanoverians as heirs to the British throne; ensuring a friendly Spain was a major achievement, but left them financially exhausted. The decentralisation of the Holy Roman Empire continued, with Prussia, Bavaria and Saxony increasingly acting as independent states. Combined with victories over the Ottomans, this meant the Austrian Habsburgs increasingly switched their focus to southern Europe.