Media playback is unsupported on your device Media caption Theresa May says she believes with her "head and her heart" that it is in the best interests of the UK

Theresa May faces a grilling from MPs later over the draft Brexit agreement the UK has reached with the EU.

The PM secured her cabinet's backing for the deal after a five-hour meeting but Brexit Secretary Dominic Raab has just resigned over it.

She has also faced a backlash from Tory Brexiteers and her Democratic Unionist Party (DUP) backers, amid suggestions of moves to force a no-confidence vote.

Labour will announce later whether or not it will back the deal.

However, leader Jeremy Corbyn said he did not believe the agreement - set out in a 585-page document - was in the national interest.

Speaking on Thursday morning, the president of the European Council, Donald Tusk, said he still saw Brexit as a "lose-lose" situation.

But he added: "As much as I am sad to see you leave, I will do everything to make this farewell the least painful possible, for you and for us."

Mr Tusk also confirmed that "if nothing extraordinary happens", an emergency EU summit will take place on 25 November to "finalise and formalise" the Brexit agreement.

Junior Northern Ireland Minister Shailesh Vara has become the first person to resign as a result of the draft agreement:

Mrs May is due to give a statement to the House of Commons on Thursday morning - this is likely to be a lengthy event, giving MPs the chance to question and put their views to her directly.

It comes the day after she emerged from the marathon cabinet meeting on Wednesday evening and declared the choice before the UK to be clear.

"This deal, which delivers on the vote of the referendum, which brings back control of our money, laws and borders, ends free movement, protects jobs, security and our Union; or leave with no deal, or no Brexit at all."

The EU said the agreement marked "decisive progress", clearing the way for a special summit of EU leaders to approve it.

Media playback is unsupported on your device Media caption When will Brexit happen?

However, Brexiteer MPs were angered by a "backstop" provision allowing the creation of a temporary "EU-UK single customs territory" to prevent border checks in Ireland in the event no trade deal is in place.

They fear it could leave the UK tied to EU rules for years.

BBC political editor Laura Kuenssberg says the threat of cabinet resignations remains live and that the prime minister could yet face a challenge to her leadership on Thursday.

Assuming she survives in post, Mrs May will face a battle to get the agreement through the House of Commons ahead of the UK's exit from the EU on 29 March.

She held talks with Labour leader Jeremy Corbyn, DUP leader Arlene Foster and Scotland's First Minister Nicola Sturgeon on Wednesday evening.

What's been agreed?

A draft agreement on the UK's withdrawal from the EU, and a statement setting out what the two sides want their future relationship to look like.

The withdrawal agreement covers so-called "divorce" issues. It includes a commitment to protect the rights of EU nationals in the UK and Britons in the EU to continue living, working and studying.

There is also a planned 21-month transition period after the UK leaves the EU in March 2019, and a "financial settlement" from the UK, thought to be between £35bn and £39bn.

The most contentious part of the negotiations has been the "backstop", which aims to guarantee that physical checks will not be reintroduced at the border between Northern Ireland and the Republic, whatever long-term arrangements are agreed further down the line.

Please upgrade your browser Your guide to Brexit jargon Enter the word or phrase you are looking for Search

The backstop will mean that Northern Ireland would stay aligned to some EU rules on things like food products and goods standards.

That will prevent the needs for checks on goods at the Irish border, but would require some products being brought to Northern Ireland from the rest of the UK to be subject to new checks and controls.

The backstop would also involve a temporary single custom territory, effectively keeping the whole of the UK in the EU customs union.

Brexiteers are angry about the prospect of being tied to EU customs rules long-term, particularly as the arrangement could only be terminated by mutual consent of Brussels and London.

Meanwhile, the DUP has said it will not tolerate anything that creates a new border down the Irish sea.

Both sides have resolved to ensure the backstop is not necessary by coming up with alternative arrangements.

A crucial 24 hours

By BBC political editor Laura Kuenssberg

The threat of resignations is still live.

Esther McVey, the work and pensions secretary, seems the most likely to go, followed by the International Development Secretary, Penny Mordaunt. And there is silence tonight and a lot of chatter about the position of the Brexit Secretary, Dominic Raab.

One might not be a problem for the PM. The departure of either Mordaunt or Raab or both, both of whom harbour ambitions for the top job, would be very dangerous for No 10.

Just as immediately - Brexiteer backbenchers are furious, just like the DUP.

And it is possible that the Parliamentary postman will be extremely busy on Thursday with letters that might trigger a challenge to Mrs May.

One senior Tory told me on Wednesday night there is likely to be a move against the prime minister in the next 24 hours. Another said they would be amazed if enough objections to start a contest hadn't emerged by lunchtime.

Read more from Laura

DUP leader Arlene Foster described her meeting with Mrs May as "frank".

"She is fully aware of our position and concerns," she tweeted.

Ms Sturgeon said Scotland was not mentioned in the agreement which she said "disregards our interests, and puts Scotland at a serious competitive disadvantage".

Irish Taoiseach Leo Varadkar praised Mrs May for "honouring her promise" to prevent a hard border.

He said Wednesday had been "one of the better days in politics", and avoiding a hard border had been "one of the most difficult challenges" of the process.

But prominent Conservative Brexiteer Jacob Rees-Mogg, who has written to MPs urging them to oppose the proposals, told BBC Radio 5 Live it was "a pretty rotten deal", keeping the UK in the EU's customs union and "splitting up" the UK.

From the pro-European side of the debate, the Best for Britain campaign said Mrs May had "sacrificed the national interest in favour of her own preservation".

The Confederation of British Industry (CBI) said the agreement was "progress" as it moved the UK "one step away from the nightmare precipice of no deal", while the Freight Transport Association and the National Farmers' Union also welcomed the publication.

The view from Brussels

By Katya Adler, BBC Europe editor

Brussels is very keen indeed not to give the impression that the EU might change or come up with a "better" Brexit deal text if this one ends up being rejected in the House of Commons.

Mr Barnier quoted Theresa May as saying that this is a deal in the UK's interest.

In fact, he spoke so warmly about the deal - how hard EU and UK negotiators had worked on it, how successful they had been in protecting citizens' rights, the Irish border and the constitutional integrity of the UK - that one colleague commented to me it was as if Mr Barnier, known for his suave French manner, believed they had managed to conjure an exquisitely designed Faberge egg out of the complex Brexit process.

No wonder then that he didn't want to engage in the possibility of that egg getting smashed.

Read Katya's blog in full