Europe’s borderless Schengen Area will be extended to cover Gibraltar after an eleventh-hour deal was reached with Spain over the future of the small British territory.
Under the preliminary agreement reached on Thursday, immigration checks at the border between Gibraltar and Spain will end.
Passports of passengers arriving and departing Gibraltar's harbour and airport will also be checked by the EU border agency Frontex, in addition to local officials.
In separate press conferences, Spanish Foreign Minister Arancha González Laya and Gibraltar's Chief Minister Fabian Picardo said they had reached an "agreement in principle" and that a full treaty would be negotiated in early 2021.
Officials reached the deal early on Thursday, hours before Gibraltar, whose sovereignty is disputed by Spain and Britain, was set to leave the EU's single market, in line with the United Kingdom.
The deal means that the territory will remain subject to rules in use within Europe's border-free Schengen area.
"After the withdrawal of the United Kingdom from the European Union, today is the beginning of a new relationship," Arancha González Laya said.
"We have understood the history of the 21st century, the need to manage our interdependence as well as our co-responsibility."
Picardo said the agreement was an opportunity to "reset our relationship with Spain and cast it in a more positive light going forward".
Gibraltar will not become a Schengen member, he said, but will become a Spanish entry point to the wider Schengen zone.
"Spain is a member of Schengen and she is extending the opportunity to enter into the Schengen area if you enter one of the entry points in Gibraltar, and Gibraltar has two entry points: ports and marinas, and the airport," Picardo said.
He said: "We're going to avert the worst effects of a hard Brexit, but of course going to the wire means there may be many loose ends to settle with very little time to go.
"There are no aspects of the framework that has been agreed that in any way transgress Gibraltar's positions on sovereignty, jurisdiction or control."
British citizens will have to present passports to enter Gibraltar as they do today, the chief minister added.