The EU will give Spain the power to veto the Brexit deal in negotiating guidelines on the future relationship to be published on Friday.

The guidelines — leaked to Business Insider — say Britain must convince Spain to support the Brexit deal.

The Spanish government wants more say over the fate of Gibraltar after Brexit.

The EU will give Britain just three months to solve the Irish border, according to reports.

The guidelines will also fall short of offering the ambitious free trade deal desired by Theresa May.

BRUSSELS, Belgium — The European Union is set to explicitly warn Britain that Spain has the right to veto any Brexit deal over the question of Gibraltar in negotiating guidelines which have been leaked to Business Insider prior to publication.

The EU will on Friday publish its negotiating guidelines for the next stage of Brexit talks, which will focus on future ties between Britain and the EU once the proposed 20-month transition period comes to an end.

The nine-page document — which the EU's negotiator Michel Barnier will use as a guide when talks resume — opens with a paragraph addressing the two withdrawal issues which still remain to be resolved: the Irish border and Gibraltar.

They suggest that although the broad terms of transition were agreed this week, the entire Withdrawal Agreement will not be signed off until agreements are reached on these other outstanding issues.

"The European Council calls for intensified efforts on the remaining withdrawal issues as well as issues related to the territorial application of the Withdrawal Agreement, notably as regards Gibraltar," it says.

Using May's own language, the text also "reiterates that nothing is agreed until everything is agreed."

The EU added this paragraph to the text this week after Spain threatened to block the updated Withdrawal Agreement being signed off at the European Council summit this week, a well-placed source in Brussels has told BI.

Here is the key paragraph:

Gibraltar — a headland of around 30,000 people on the southern coast of Spain — is a British overseas territory.

However, Spain is yet to abandon its hope of regaining at least some control over the territory which it lost to British-Dutch forces in the early 18th century. Speaking after the June Brexit vote, Spain's former foreign minister Jose Manuel Garcia-Margallo said he hoped that to seeing the "Spanish flag on the rock [Gibraltar]" was "much closer" to becoming reality.

The Spanish government this week told Brussels it wants the power to veto any deal which would keep Gibraltar in the single market and customs union after Brexit day in March 2019.

This was after UK Brexit Secretary, David Davis, said on Monday that the territory would automatically be included in the status quo transition deal agreed this week by UK and EU negotiators.

The Spanish were "pissed off by Davis' comments on Monday," an EU source told BI.

This development provides another headache for Theresa May, who is already tasked with finding a way of avoiding a hard border on the island of Ireland after Britain leaves the single market and customs union.

The UK government will now have to have bilateral discussions with Madrid in order to find an agreeable compromise, in order to Brexit negotiations to progress.

The European Union will also tell Prime Minister Theresa May that she has just three months to produce a workable solution for avoiding a hard border between Northern Ireland and the Republic, The Times reports.

If not, then Northern Ireland will default to the "fallback" option proposed by Brussels last month, which would keep it within the EU's customs zone and aligned to single market rules.

EU to offer limited free trade deal

The guidelines will reiterate that a free trade agreement with limited market access is the best arrangement Britain can hope for as long as the UK government sticks to its red lines of leaving the single market and customs union.

The EU will call for continued tariff-free trade on goods but offer limited single market access for services. It will also repeat that leaving the customs union makes increased checks at the border unavoidable.

"As regards the core of the economic relationship," the guidelines will say, "the European Council confirms its readiness to initiate work towards a balanced, ambitious and wide-ranging free trade agreement (FTA) insofar as there are sufficient guarantees for a level playing field.

"This agreement will be finalised and concluded once the UK is no longer a Member State. Such an agreement cannot however offer the same benefits as Membership and cannot amount to participation in the Single Market or parts thereof."

The EU27 is set to approve the guidelines at the European Council summit taking place in Brussels today and Friday.