Spain lost it during the War of the Spanish Succession (1701–1714), in which England got into in order to counter the growing french power in Europe and in the colonies outside the old continent. Philip V, the french candidate, became the Spanish king so that was a victory for France, but in exchange GB gained some of the french territories in North America and Gibraltar too. Great Britain grab Gibraltar in order to have control over the Mediterranean's gate, to protect its trade routs through that sea. Then it became a very important enclave in its way to India. Nowadays Spain wants Gibraltar back because its seen as a core part of its territory, but in the XIX and XX century he wanted it back because the british could blockade the connection between its african holdings and the spanish mainland taking advantage of the enclave. Gibraltar represents Spain's historical failure and the foreign powers' intervention into spanish affairs