16:39

A hard fought agreement struck between the UK and EU over a 21-month transition period has been thrown into doubt after Spain insisted that its veto over the deal covering Gibraltar needed to be made clear.

The Guardian understands that Madrid is unconvinced that the 129-page withdrawal agreement, containing the terms of the transition, is concrete enough on the issue.

The EU is insisting that the UK and Spain must come to a bilateral accord with over the future of the Rock before it can benefit from an additional period of time in the single market and customs union.

It is understood that Spain is holding back on endorsing the withdrawal agreement, of which 75% has been agreed by the UK and EU, until changes are made to the document in its favour.

Talks are ongoing among the member states and EU officials in Brussels.

In an open letter ahead of a leaders summit, where the 27 member states were accepted to give their support to the withdrawal agreement, Donald Tusk, the president of the European council writes:

Whether all 27 member states can welcome this at the European Council remains open. I still need a couple more hours to consult with some of the most concerned member states.

Clause 24 of the EU’s negotiating guidelines states agreed last year says that any transition agreement or future trade relationship between the UK and the EU can only be extended to Gibraltar after bilateral agreement between the UK and Spain.

The UK believes that this is not legally watertight.

Asked by a Spanish journalist on Monday whether the transition agreement covered Gibraltar, the Brexit secretary David Davis replied: “Yes, it does cover Gibraltar. That is our view of it.”

Responding to the same question, the EU’s chief negotiator Michel Barnier acknowledged that the legal text agreed by Brussels and the UK included Gibraltar in its scope before adding that there remained a caveat. He said:

Gibraltar leaves the European Union at the same time as the United Kingdom [and] legally, we’ve specified the territorial scope of the agreement. But there’s a reference which remains valid [and] which member states are keen on, all member states of the European Union on behalf of whom I negotiate.

Barnier was referring to the clause 24 veto included in two sets of negotiating guidelines agreed by the EU over the past year. He said: