The UK has been accused by Spain of “treachery” and acting “under the cover of darkness” in an escalation of a war of words over the future of Gibraltar that risks derailing Theresa May’s Brexit deal.

May defends under-fire Brexit plan: 'a deal is within our grasp' Read more

Marco Aguiriano, Spain’s secretary of state for the EU, said on Thursday that his government could “stop the clock” on the negotiations and force May and the other EU leaders to come back in December unless it gets its way in the next 48 hours.

Madrid has insisted from the start of the Brexit negotiations that it would not tolerate the Rock, a disputed territory, benefiting from agreements made in the talks without Spain’s consent.

The UK has been accused of introducing a clause into the withdrawal agreement that would ensure Gibraltar was covered by a future trade deal negotiated with Brussels.

Aguiriano said: “We’re worried because this paragraph, which was introduced almost treacherously and under the cover of darkness, could be used by the UK in the future to argue that a future agreement between the EU and the UK could be applied to Gibraltar without necessarily requiring the prior agreement of Spain.

“The minutes that run through the night and into the hours of the early morning really count as the European council anticipates finishing its business. Or the clock could even be stopped and another European council could be called. That’s nothing extraordinary or surprising; in fact, it’s even fairly usual.

“This government … has shown very clearly what its position is: it will not agree to the withdrawal deal and the future declaration on Sunday if the question I have already outlined in great detail is not clarified.”

Key Brexit dates: what happens next? Read more

May, speaking on the steps of Downing Street earlier on Thursday, said she had spoken to the Spanish prime minister, Pedro Sánchez, and was “confident that on Sunday we will be able to agree a deal for the whole of the United Kingdom family including Gibraltar”.

Play Video 2:23 Theresa May says Brexit deal is 'within our grasp' – video

However, Sánchez later tweeted that, after speaking with May, “our positions remain far away” and if there were no changes to the deal, then “we will veto Brexit”.

Spain does not have a veto on the Brexit deal, but the 26 other EU member states would not want to adopt the withdrawal agreement and political declaration, published on Thursday, without Madrid’s support.

EU sources said they feared the issue might be left open until May returned to Brussels on Saturday evening to meet the European commission president, Jean-Claude Juncker.

The row raised the threat that the signoff by leaders could be pushed back to the next European council in December, although EU diplomats insisted that such a move would be seen as “disastrous” by the other leaders.

On Tuesday night, in a sign of the tensions within the EU over the issue, the Spanish ambassador to the bloc, Juan Pablo García-Berdoy, was said to have reprimanded his German counterpart, Michael Clauss, for attempting to close down the issue during a meeting of diplomats in Brussels.

Brussels Brexit talks: what are the sticking points between UK and EU? Read more

“We supported the reunification of Germany out of solidarity. Where is the solidarity now?” García-Berdoy is understood to have said.

Aguiriano told parliamentarians in Madrid that he wanted it in “black and white” that the future of Gibraltar would have to be negotiated separately from the trade deal with the UK.

He said: “It has to be crystal clear: the tenor of the withdrawal deal and the tenor of the political declaration have to be abundantly clear that any future relations between the EU and the UK regarding Gibraltar have to be negotiated separately from the general future relationship between the EU and the UK, and must get Spain’s seal of approval.”