Britain has given assurances to Spain on Gibraltar, unlocking the Brexit deal a day before EU leaders meet in Brussels to sign off on the draft withdrawal agreement and political declaration.

"We have worked through the withdrawal issues for Gibraltar in a constructive and sensible way," Theresa May said on Saturday. "We have ensured that Gibraltar is covered by the whole agreement and by the implementation period."

Spanish prime minister Pedro Sanchez threatened to veto the Brexit withdrawal agreement if no changes were made over Gibraltar— a disputed overseas British territory Spain has sovereignty claims over.

Sanchez acknowledged the agreement with Britain today and said any future decisions regarding Gibraltar would be made with Spain. The consensus has cleared the way for the EU summit on Sunday to approve British Prime Minister Theresa May's Brexit deal, a decision backed by European Union summit chairman Donald Tusk.

Concerning Gibraltar, the British government "will negotiate the future agreements implementing the Joint Political Declaration on behalf of all territories for whose external relations the UK is responsible to ensure an appropriate and beneficial future relationship with the EU, taking into account their existing relationships with the European Union," according to a letter from British ambassador to the EU council Tim Barrow clarifying Article 184.

The Spanish government wanted clarification on Article 184 of the draft, which relates to negotiations on the future relationship between the EU and Britain, saying the text was ambiguous on Gibraltar and wanted Britain to have direct talks with Madrid concerning "The Rock."