A Brexit deal will not automatically apply to the overseas British territory of Gibraltar and could be vetoed by Spain, according to the EU’s draft guidelines for the UK’s exit negotiations.

It came as Donald Tusk, the European Council President, set out the EU’s nine-page draft negotiating position, making clear Britain must make significant progress with its divorce from Europe before any talks on future trade terms begin.

But in what will be viewed as a significant diplomatic victory for Madrid, however, the guidelines add: “After the United Kingdom leaves the Union, no agreement between the EU and the UK may apply to the territory of Gibraltar without the agreement between the kingdom of Spain and the UK.”

It means issues relating to the territory will have to be solved bilaterally between Downing Street’s negotiating team and Madrid and will likely become a contentious point throughout the two-year timeframe to negotiate Britain’s exit deal.

The territory – situated on Spain’s southern tip – has been in British hands for over 300 years and residents there voted overwhelmingly in favour of remaining within the EU at the referendum last June by 96 per cent.

But speaking shortly after the vote last year Spain’s acting foreign minister Jose Manuel Garcia-Margallo expressed his hope that “the Spanish flag on the Rock” was “much closer” to reality. The suggestion, however, that the vote could lead to shared sovereignty for the territory and its eventual return to Spain was rejected by the Gibraltar and British governments.

The draft guidelines also make clear the EU is willing to consider a “transitional” deal after Brexit and is also prepared for talks to collapse.

Mr Tusk's document said: "In these negotiations the Union will act as one. It will be constructive throughout and will strive to find an agreement. This is in the best interest of both sides.