Gibraltar was part of the European Union, having joined through the European Communities Act 1972 (UK), which gave effect to the Treaty of Accession 1972, as a dependent territory of the United Kingdom under what was then article 227(4) of the Treaty Establishing the European Community covering special member state territories, with exemption from some areas such as the European Union Customs Union, Common Agricultural Policy and the Schengen Area. It is the only British Overseas Territory which was part of the European Union. After a 10-year campaign for the right to vote in European elections, from 2004 to 2019 the people of Gibraltar participated in elections for the European Parliament as part of the South West England constituency. On 23 June 2016 Gibraltar voted along with the United Kingdom in the EU referendum; 96% of its population voted to remain, but the overall United Kingdom result gave a 51.9% majority to leaving the EU. Nevertheless, Spanish Prime Minister Pedro Sánchez stated on 18 October 2018 that the Gibraltar protocol had been "resolved" and that Spain will hold no objection when Gibraltar leaves the EU with Britain.