Gibraltar is a 2.6 square mile headland to the south of Spain.

The UK has had sovereignty over Gibraltar since 1713, although this is disputed by Spain, who claim the territory as their own.

The territory’s status and that of its border with Spain has been a key sticking point and has remained unresolved since Brexit.

An estimated 15,000 people cross the Gibraltar-Spain border every day for work and leisure.

Currently, Gibraltar residents can cross using residence cards without needing to have their passports stamped. Spanish citizens can cross using a government ID card.

But there were concerns this would end with the introduction of the EU’s Entry/Exit system later this year, causing huge delays at the border.

The UK said all sides had agreed a clause making clear the final treaty does not impact the territory’s British sovereignty.

It said there would also be full operational autonomy of the UK’s military’s facilities in Gibraltar, where the airport is run by the Ministry of Defence and hosts an RAF base.

Public opinion in Gibraltar, which has a population of around 32,000, is in favour of keeping British sovereignty. The most recent referendum, held in 2002, saw almost 99% of voters reject a proposal to share sovereignty with Spain.

The breakthrough came after Lammy met Picardo and his cabinet in Gibraltar earlier, before the pair headed to Brussels for discussions with EU and Spanish ministers.