Spain has threatened to withdraw support for the draft Brexit divorce deal if its Gibraltar "veto" does not apply to a future trade deal between the UK and the EU.

Josep Borrell, Spain's foreign minister, warned that both sides should prepare for "last-minute surprises" as splits appeared among EU member states over the in-principle deal agreed with the UK last week by Michel Barnier, the EU's chief negotiator.

"We want to make sure the interpretation of this text is clear and shows that what’s being negotiated between the EU and the UK does not apply to Gibraltar," said Mr Borrell.

“The future negotiations over Gibraltar are separate,” he added. “Until that’s clear in the exit text and the political declaration over the future relationship, we won’t be able to agree to it.”

Earlier, Mr Borrell told Onda Cero radio that EU consensus around the draft Withdrawal Agreement may "not be as peaceful as it seems".

Spain has what has been described as a "veto" over the Brexit withdrawal agreement applying to Gibraltar and has been holding bilateral talks with Britain over the territory.

But the country has grown anxious that it might have no say over a trade agreement between the UK and EU also covering Gibraltar.

Mr Borrell added that Theresa May "has said that [the UK] will not approve the withdrawal agreement until it has the future relationship; well, it’s the same for us: until we know what it says, we will not approve the withdrawal agreement".