Spain on Saturday agreed to support a Brexit deal, but only after the U.K. and E.U. agreed to give Spain a say in the future of the disputed British territory of Gibraltar.

“We have reached a historic agreement and tomorrow we will vote in favor of Brexit,” Spanish Prime Minister Pedro Sanchez told reporters. “Europe and the United Kingdom have accepted our demands. Spain achieves a triple armory with which it can definitively deal with the United Kingdom [over] the future of Gibraltar in the coming years.”

The agreement means that an agreement on Britain's withdrawal from the European Union should easily be signed off on on Sunday morning; Spain is so longer threatening a veto. But it is another concession that British Prime Minister Theresa May has made in order to secure a deal ahead of Britain's departure from the E.U. in March.

Spain wanted the future of Gibraltar, a territory on the southern tip of Spain that was ceded to Britain in 1713, to be an issue between Spain and Britain rather than Britain and the E.U.  The agreement says that Madrid will be given a say on matters concerning Gibraltar when it comes to future trade deals.

In a letter obtained by The Associated Press, European Commission President Jean-Claude Juncker and European Council President Donald Tusk assured Sanchez that Spain's "prior agreement" would be needed on matters concerning Gibraltar.

The U.K. Telegraph reported that the British government has conceded in writing that no part of any future trading agreement can apply to Gibraltar without the agreement of the Spanish government -- leading to fears that the Spanish may use that power to extract a deep range of concessions on issues such as taxation and fishing.

May said that Britain, which voted to leave the European Union in a 2016 referendum, hadn’t conceded sovereignty of GIbraltar.

"I will always stand by Gibraltar," May said. "The U.K. position on the sovereignty of Gibraltar has not changed and will not change."

THERESA MAY FIGHTS FOR POLITICAL SURVIVAL AFTER DRAFT BREXIT DEAL SPARKS RESIGNATIONS, CALLS FOR HER OUSTER

But the concessions are likely to only increase nervousness in Britain, where she is under significant pressure from both Brexiteers and Remainers over the deal she has hashed out with European leaders ahead of Britain’s departure from the bloc in March.

Liberal Democrat Party Brexit spokesman Tom Brake accused May of having "caved in."

"She has conceded that Gibraltar won't necessarily be covered by a future trade deal, simply another example of why what she has negotiated is completely unacceptable," he said, according to Sky News.

Even if she secures E.U. support, she still has the gargantuan task of getting the deal through Parliament, where her Conservative Party holds a slim majority and is bitterly divided. A number of ministers, including two Cabinet ministers, have resigned over the deal -- with pro-Brexit voices saying that it does not result in Britain’s departure from the E.U. and could tie Britain to the bloc indefinitely.

She was dealt another blow on Saturday when the leader of Northern Ireland's Democratic Unionist Party, on which May relies to get her government majority, rejected the deal, arguing it would drive a wedge between Northern Ireland and the rest of the United Kingdom.

The Associated Press contributed to this report.