On 31 January 2020, the UK left the European Union and consequently so did Gibraltar. Under the terms of the transition phase in the Brexit withdrawal agreement, Gibraltar's relationship with the EU continued unchanged until the end of 2020 when it was replaced by the EU–UK Trade and Cooperation Agreement. On 31 December 2020, the UK and Spain agreed in principle on a basis for the EU and the UK to negotiate an agreement through which Gibraltar would participate in the Schengen Area, to avoid a hard border with Spain. The arrangements have not entered into force, but both sides aim to keep delays at the border at a minimum in the meantime.