Theresa May has arrived in Brussels ahead of an EU summit on Sunday which is set to see the bloc approve her Brexit deal.
The prime minister was pictured smiling and shaking hands with European Commission president Jean-Claude Juncker on Saturday evening.
It comes after emergency talks appeared to have placated Spanish reservations about the issue of Gibraltar, which Spain threatened to use as a veto.
European Council president Donald Tusk declared Sunday's planned summit of EU leaders "closer" to going ahead after apparently appeasing Spanish Prime Minister Pedro Sanchez.
Mr Tusk said: "I will recommend that we approve on Sunday the outcome of the Brexit negotiations.
"No one has reasons to be happy. But at least at this critical time, the EU27 has passed the test of unity and solidarity."
The tensions over Gibraltar concerned Spain's demand that Gibraltar's future is considered a bilateral issue between London and Madrid rather than between the EU and UK.
Following emergency discussions, Mr Sanchez said: "Europe and the United Kingdom have accepted our demands."
Madrid's foreign minister Josep Borrell went further, saying the agreement is "highly positive for Spain" and "the most important" since the Treaty of Utrecht in 1713 under which Gibraltar was ceded to the UK.
But Mrs May insisted the UK's position on Gibraltar had not changed and that she would always "stand by" its citizens.
She said: "We have ensured that Gibraltar is covered by the whole Withdrawal Agreement and by the implementation period and we will always negotiate on behalf of the whole UK family, including Gibraltar, and in the future relationship we will stand up for their interests.
"The UK's position on the sovereignty of Gibraltar has not changed and will not change."
Gibraltar's Chief Minister Fabian Picardo used a live TV address to dismiss Mr Sanchez's claims: "The Government of the UK has been completely firm in its resolve and in our support.
"What you have heard from the Spanish Prime Minister today was not a reflection of any new position, however much he tried to present it as such."
Ahead of the summit, the prime minister will hold talks with Mr Tusk and Mr Juncker early on Saturday evening.
But Mrs May is continuing to face domestic difficulties, with her relationship with the Democratic Unionist Party looking increasingly strained as Arlene Foster’s party held its conference in Belfast.
DUP leader Arlene Foster warned that the confidence and supply deal propping up Mrs May’s minority administration would have to be "revisited" if her Brexit deal gets through Parliament.
The DUP has strongly opposed the deal and the guest star at its conference is Boris Johnson, a prominent critic of the Prime Minister’s approach and a potential rival for the Tory leadership.
Mrs May has insisted her deal is in the interests of "the whole UK family" including Gibraltar.
The last-minute diplomatic spat comes as Mrs May’s critics laid bare the scale of their opposition to the Brexit plan.
More than 80 Conservative MPs – from both the Leave and Remain sides – are threatening to vote against the agreement.
And if it did pass the Commons, the repercussions could bring down Mrs May’s Government, with the DUP hinting at withdrawing the support of its MPs.
The DUP’s 10 MPs have proved reluctant to vote with the Government since the terms of the Brexit deal became known and the termination of their Westminster arrangement would be a major blow to the Prime Minister.
In her conference speech, Mrs Foster said that the constitutional implications for the draft EU deal "cannot be ignored".
"The Democratic Unionist Party has never been afraid to say yes when it is right to do so, nor to say no when required," Ms Foster said.
"We do not stand alone on these issues, with a large number of Conservatives - both those who voted leave and remain - not persuaded. Even Jeremy Corbyn isn't buying the sea border.
"This party wants to see a negotiated and orderly withdrawal from the European Union - that has always been our position. We are not campaigning for a no-deal exit nor do we want barriers to trade between Northern Ireland and our neighbours in the Republic.
"The choice is not between this deal and no deal, despite what the Government spin machine may say."
Mrs May, who launched an effort to sell the Brexit deal directly to the public, has insisted that there would be no changes to appease critics at this late stage.