London CNN  — 

British Prime Minister Theresa May’s efforts to pass a Brexit deal have suffered a further setback after Spain threatened to veto her draft divorce agreement over the handling of Gibraltar.

Madrid has objected to part of the deal that covers future trade and security relations between the UK and the European Union. It insists arrangements relating to Gibraltar, a small British territory on the southern tip of Spain, should be discussed separately.

Spain would not back the deal until the issue is clarified, Spanish Foreign Minister Josep Borrell said after discussions with EU chief negotiator Michel Barnier and EU ambassadors.

Spain has long claimed sovereignty over Gibraltar, which has been a British territory since 1713. But Gibraltarians, who voted almost unanimously to remain in the European Union in the 2016 referendum, are fiercely loyal to Britain and have resisted Spanish claims.

The draft Brexit deal must be agreed on at an EU summit on November 25. An EU official told CNN that it was likely the issue would be ironed out before the EU Council meets over the weekend: “I am confident this will be solved before Sunday,” the official said.

But Madrid’s objections will frustrate May’s efforts to see the deal through the EU smoothly before it returns to the UK Parliament for a final vote.

Spain wants negotiations over future arrangements for Gibraltar to be conducted separately from wider trade and security discussions.

A spokesman for May said Gibraltar should be included in the talks over the future relationship between the UK and the EU. “The PM has been clear that we will not exclude Gibraltar and the other overseas territories and crown dependencies from our negotiations on the future relationship.”

Gibraltar’s Chief Minister Fabian Picardo said that the Spanish government’s position “does little to build mutual confidence and trust going forward.”

“The language of vetoes and exclusions should be the language of the past,” he added.

Further troubles for May

May’s fight to save her under-fire Brexit deal, which prompted a series of resignations from her government last week, was further damaged Tuesday by the refusal of Democratic Unionist Party members to back her government in a number of finance votes in the UK Parliament.

Under the terms of an agreement between the DUP and the Conservatives, the Northern Irish pary’s 10 members of Parliament vote with the government on key legislation. The DUP’s decision to breach the deal on Tuesday night was seen as a warning shot to May.

Its support is crucial if May is to have a chance of pushing her EU withdrawal deal through Parliament. But the DUP has fiercely criticized the draft agreement since it was published last week.

A further blow was handed to May by the UK’s Supreme Court, which refused to hear a government appeal in a case over whether Article 50, the section of the Lisbon Treaty that triggered the Brexit process, can be unilaterally revoked.

The case, brought by a group of lawmakers who support remaining in the EU, is being heard by Scotland’s highest court, the Court of Session. The government had opposed the Court of Session’s decision to refer it to the European Court of Justice, fearful that a successful ruling in Strasbourg would embolden British lawmakers to call for Article 50 to be rescinded.

“We are disappointed by the decision of the court and it remains a matter of firm policy that we will not be revoking Article 50,” a government spokesman said.

CNN’s Erin McLaughlin contributed reporting from Brussels