Eurosceptics in May's Conservative party and their Northern Irish allies warn they will not support the agreement when MPs vote as expected next month.
It then led to May's comments about Britain's position on the territory.
That was clearly on the minds of European Commission officials Sunday as EU leaders gave their backing to the terms of Britain's split from Brussels after 44 years of membership.
Juncker told journalists: "I'm inviting those who have to ratify this deal in the House of Commons to take this into consideration: this is the best deal possible for Britain, this is the best deal possible for Europe, this is the only deal possible, the only deal possible".
"I am totally convinced this is the only deal possible", he said.
"I am proud that Gibraltar is British and I will always stand by Gibraltar".
United Kingdom prime minister Theresa May has vowed that she will "always stand by Gibraltar" despite striking a compromise with Spain in order to get her Brexit deal with the European Union over the line. "In the future, we will continue to negotiate on behalf of the whole United Kingdom family and that includes Gibraltar", she added.
But nothing in the negotiations has gone smoothly and the summit risked being derailed by a late objection to the deal by Spain over the British territory of Gibraltar.
United Kingdom prime minister Theresa May has revived Vote Leave's controversial claim that Brexit will benefit the National Health Service (NHS) in a bid to sell her freshly-signed divorce deal to sceptical MPs and members of the public.
Kemba Walker’s historic 60-point night
So he did what I wanted him to do [and drove]. "I think we've done that - we can't think about the play-offs just yet". As for the game-winner, he said it's a shot he practices often, and worked on it 50 times earlier that morning.
Her aides say she is banking on the "fear factor", daring the House of Commons to vote down a deal which if rejected would leave Britain most likely crashing out of the bloc, its largest trading partner, without any agreements, which would be costly economically and would nearly certainly push the country into recession.
The agreement will head to British Parliament for an approval vote in December, which could determine whether or not the plan remains intact before Britain actually exits the European Union.
And Andrew Bridgen, a Conservative minister, said: "It appears that there is no-one the prime minister will not betray to achieve her sell-out deal".
"In this tragic and sad situation, what is good is that we have gone down a hard path with this withdrawal agreement and that should give us assurance and strength so that we can sort out the future relations too".
Gibraltar was the final issue to be resolved after 18 months of negotiations, paving the way for the deal to be signed-off at Sunday's summit.
Chief Minister Fabian Picardo fired back at Spanish Prime Minister Pedro Sanchez on Saturday night, dismissing his claims that Spain had secured "historic" gains in its sovereignty aspirations over Gibraltar.
"The British people don't want to spend any more time arguing over Brexit", she said. "It is tragic that Great Britain leaves the European Union after 45 years but we have to respect the vote of the British people and, based on this, it is good that we agreed on a withdrawal agreement and a political declaration about future ties with Great Britain".
Tajani said a "large majority" of European parliamentarians supported the deal.
He warned that a no-deal Brexit would unleash "economic chaos", adding: "If the meaningful vote is lost we are in uncharted territory".
In this deal Britain is set to face a $50 billion bill to pay as the leave the European Union, according to The Washington Post.
Using a press conference in Brussels to make a direct appeal to them, she said one of the benefits of her deal would be an end to "vast payments" into the European Union's budget.