Image copyright Reuters Image caption The 27 other EU leaders have stressed there is still a long way to go

EU leaders are expected to formally agree to start the next phase of Brexit negotiations later.

It means talks can move on to the long-term relationship between the UK and EU, days after Theresa May suffered her first defeat in the House of Commons.

The next round of talks on a transition period after the UK leaves in March 2019 could begin as early as next week.

European Commission President Jean-Claude Juncker said this process would be "significantly harder".

Mrs May was applauded by other leaders at dinner in Brussels on Thursday night after she made a speech urging the two sides to embrace the way ahead with "creativity and ambition".

The European Commission has said "sufficient progress" has been made on the first phase to move onto discussing the framework of a future relationship - including issues such as security and trade.

Mr Juncker said the EU's initial priority was to "formalise the agreement we have now" on issues such as citizens' rights before starting negotiations on a future relationship after the UK leaves in March 2019.

"The second phase will be significantly harder than the first and the first was very difficult," he warned.

Media playback is unsupported on your device Media caption May: We've won 35 out of 36 votes

Speaking to reporters, German Chancellor Angela Merkel said progress had been made but there was "much more work to be done and time is of the essence".

Under EU rules, the prime minister will not attend the meeting where the decision is formally confirmed. She has now returned to the UK.

During the dinner with the 27 other EU leaders, Mrs May urged them to approve an agreement to move Brexit talks on to a second phase.

In a brief speech, she stressed her keenness to get on with shaping a "deep and special" future partnership as quickly as possible, leaving no doubt that she believes she was "on course to deliver Brexit".

She said she made "no secret" of wanting to move on to the next phase and to approaching it with "ambition and creativity".

"A particular priority should be agreement on the implementation period so that we can bring greater certainty to businesses in the UK and across the 27," she said.

Image copyright AFP/Getty Images Image caption German chancellor Angela Merkel has warned "time is of the essence"

In applauding Mrs May, Mr Juncker said her EU colleagues "felt that she did make a big effort and this has to be recognised" while Austrian Chancellor Christian Kern said he appreciated "her efforts and engagement".

But Maltese PM Joseph Muscat said the UK must spell out "very clearly" what it wanted from its post-Brexit relationship with the EU for the talks to proceed smoothly.

The text likely to be rubber-stamped by the leaders will promise to work towards a "framework" for a trade deal - with a wait until March before guidelines for the way ahead are produced.

'Good progress'

The document states that a formal free trade agreement cannot be signed until after the UK has left the EU.

The talks will first prioritise translating recent headway on the issues of citizens' rights, the Irish border and the "divorce bill" into a legally-binding withdrawal agreement - as well as to work out the terms for a transition period to follow the official date of Brexit.

Media playback is unsupported on your device Media caption Is it game over for Brexit?

The EU leaders will stay on to discuss the eurozone as the two-day summit draws to a close - having also debated the flow of migrants over the Mediterranean and sanctions on Russia.

Mrs May has said the Brexit process is still "on course" despite her defeat in a Parliamentary vote on Wednesday night.

Speaking in Brussels, Mrs May said she was "disappointed" at the vote on the EU Withdrawal Bill, but the legislation was making "good progress".

MPs backed an amendment giving them a legal guarantee of a vote on the final Brexit deal struck with Brussels.

Ministers are due to have their first discussion of the "end state" relationship between UK and the EU in a cabinet meeting on Tuesday.

Meanwhile, Mrs May is facing a further challenge next week when MPs vote on a government amendment to enshrine the Brexit date of 29 March 2019 in law.

The BBC's political editor Laura Kuenssberg said there was no sign so far that Mrs May was going to budge on the issue but further compromises could be "forced on her".