A Union flag, left, flaps in the wind alongside EU flags in front of European Commission headquarters in Brussels. Picture: Virginia Mayo/AP

Brussels - British and EU negotiators have agreed on a joint text outlining their goals for the future relationship after Brexit, European Council President Donald Tusk announced on Thursday, but last-minute negotiations on various issues were still underway.

The declaration on future relations now needs the full approval of the leaders of the 27 EU countries remaining after Brexit, who are holding a special summit in Brussels on Sunday.

Speaking outside Downing Street in London, Prime Minister Theresa May said it was "the right deal for the UK" and delivers on the result of the 2016 referendum.

The joint political declaration goes hand in hand with the withdrawal agreement, a legal document detailing the terms of Britain's exit from the European Union on March 29, 2019.

However, several issues remain to be addressed, commission spokesman Margaritis Schinas told journalists in Brussels.

One of the final stumbling blocks is the question of Gibraltar, a British territory on the southern tip of Spain over which Madrid also claims sovereignty.

Spain is pressing for a change to the wording in the withdrawal deal, clarifying its role in any future negotiations on Gibraltar. However, other member states are loath to reopen the 585-page document.

May is due to meet with Juncker again on Saturday to review the state of play.

She has faced fierce domestic opposition to the Brexit deal and it looks unlikely to win the approval of the British parliament, at least in the expected first vote next month.

Addressing parliament later Thursday, May pointed to progress in addressing lingering British concerns about a so-called backstop provision to maintain an open border on the island of Ireland.

The temporary, last-resort backstop is designed to ensure a free flow of goods and people across the border between the Republic of Ireland, which will remain in the EU, and Northern Ireland, which will leave with the rest of Britain in March.

Labour's Jeremy Corbyn, who leads the main opposition party, said the backstop "would create a new regulatory border down the Irish Sea."

The political declaration is "26 pages of waffle," Corbyn said. "This empty document could have been written two years ago."

Justine Greening, a pro-EU lawmaker from May's Conservatives, asked her whether she accepted that if parliament rejects the Brexit deal, "the only right option then is to go back to the people and allow them to have a final say."

"As I have said on many occasions... the people of Britain voted to leave the European Union," May replied, referring to the referendum in 2016.

The 26-page document will form the basis for negotiations on a political and trade deal that can begin as soon as Britain has left the EU.

Negotiators have also decided on the maximum length of the post-Brexit transition period, during which London will still be bound by EU rules and must keep paying into the bloc, without having any say.

At present, the transition period - designed to provide stability for citizens and businesses, and for administrative purposes - is due to apply for 21 months, until the end of 2020.

Thursday's agreement allows the transition to be extended by up to two years.