Relations between the European Union (EU) and the United Kingdom of Great Britain and Northern Ireland (UK) date back to the foundation of the European Communities, the European Union's predecessor, in 1957. The United Kingdom was a member state of the European Communities after joining it in 1973. It was a member state of the European Union until it became the first country to voluntarily end its membership on 31 January 2020 after a referendum was held in 2016 which resulted in 51.9% of voters opting to leave. The Brexit withdrawal agreement now plays a significant role in relations between the two entities, especially for Northern Ireland (which continues to apply EU rules relating to goods, VAT in respect of goods, excise, agricultural and fisheries product and electricity, as well as applying the EU customs code and effectively acting as the EU customs border with Great Britain while legally remaining in the UK's customs territory), and during the transition period which lasted until 31 December 2020. Since 1 January 2021 the relations have been mainly governed by the EU–UK Trade and Cooperation Agreement. The United Kingdom borders one European Union member state: Ireland.