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.

Read More