Ministers will again battle to win over MPs to Theresa May’s Brexit deal later, a day after the government suffered three defeats on key votes.
Security will be the focus of the second of five days of debate in the Commons, where Tuesday’s marathon session extended into the early hours.
Crucially, MPs backed calls to give them a direct say in what happens if Mrs May’s deal is rejected next week.
The government is due to publish its Brexit legal advice at 11:30 GMT.
Ministers agreed to release the advice in full after MPs voted to find the government in contempt of Parliament for ignoring a Commons vote demanding publication.
The PM’s deal has been endorsed by EU leaders but must also be backed by the UK Parliament if it is to come into force. MPs will decide whether to reject or accept it next Tuesday, 11 December.
The UK is due to leave the European Union on 29 March, 2019. Ministers say that if MPs reject their deal they increase the chances of the UK leaving without a deal, or not leaving the EU at all.
Ministers will plough on with attempts to win over MPs on Wednesday, with eight hours of debate on the security and immigration aspects of the withdrawal agreement.
Meanwhile, Mrs May is expected to continue trying to convince small groups of her MPs to back the plan in private meetings.
Mrs May will face Labour leader Jeremy Corbyn at prime minister’s questions, at mid-day, before the Brexit debate gets under way.
Warnings falling on deaf ears?
Brexiteer cabinet minister Michael Gove has warned his fellow MPs that if they do not vote for Mrs May’s deal, they “risk there being no Brexit”.
Speaking outside his home, the environment secretary said: “We’re going to make a powerful argument that this deal is in the best interests of the country.
“Everyone has to think at this momentous moment – do we want to ensure that Brexit gets over the line? Do we want to deliver on the verdict of the 17.4 million people who voted to leave the European Union because if we don’t back the prime minister, we risk there being no Brexit and that I think would be a fatal blow to faith in democracy.”
But a former Conservative chief whip has said he expects the PM to lose the vote.
Mark Harper, who backed Remain in the referendum told the Daily Telegraph he would vote against the withdrawal agreement, and predicted the deal would be rejected by 80 of his party colleagues.
He urged the prime minister to renegotiate the deal, insisting the current plan would leave the UK worse off.
Why did the defeats matter?
First, the government lost a bid to have the legal advice issue dealt with separately by a the Privileges Committee of MPs.
In a second defeat, ministers were found in contempt of parliament and forced to concede they would have to publish that advice in full, having previously argued this would break convention and was not in the national interest.
Most significantly, the third defeat was over changes to the parliamentary process in the event that the Commons votes down Mrs May’s deal.
Instead of being confined to merely “taking note” of what the government tells them, MPs would also be able to exert more influence by voting on what they want the government to do next.
This could potentially see Parliament wrest control of the Brexit process from ministers if, as expected, MPs push for a “Plan B” alternative to Mrs May’s deal and seek to prevent any chance of Britain leaving the EU without a deal in place.
Former Attorney General Dominic Grieve, who brought the motion, told Channel 4 News it would “allow the UK time to consider its options”, including re-starting negotiations with the EU or giving the public the final say.
Liberal Democrat leader Sir Vince Cable said: “The Commons is now very likely to defeat the government again next week on the Brexit deal, at which point the country must be given a ‘People’s Vote’, and asked to choose between the deal or remaining in the EU.”
A glimmer of hope for the PM?
By BBC Political Editor Laura Kuenssberg
Former Remain rebels now have a possible route to get what they want if the PM’s plan is rejected, as there is a possible – I emphasise the possible – way to get a vote with a majority for a Norway-style agreement or, less likely, a push for another referendum.
That won’t go unnoticed by Brexiteers too, who may feel (some of them at least) that Mrs May’s deal might be their best bet in that case, rather than risk that softer, squidgier Brexit.
It’s possible therefore that Tuesday’s shenanigans have made it less likely that the prime minister will face a terrible defeat next week because a few wobbly rebels on both sides might come in line.
How did the PM try to win over MPs?
When she finally kicked off the debate about the deal itself, Mrs May insisted the UK would enjoy a “better future” outside the EU.
She said the “honourable compromise” on offer was “not the one-way street” many had portrayed it to be and that the EU had made it clear that the agreement would not be improved on.
“I never said this deal was perfect, it was never going to be. That is the nature of a negotiation,” she said.
“We should not let the search for a perfect Brexit prevent a good Brexit.”
And what was the reaction?
Labour leader Jeremy Corbyn said it was a bad deal for the UK and that his party would seek a vote of no confidence in the government if it was thrown out by MPs.
“I hope and expect this House will reject that deal,” he said.
“At that point, the government has lost the confidence of the House. Either they have to get a better deal from the EU or give way to those who will.”
Nigel Dodds, leader of the DUP in Westminster, said the agreement “falls short” of delivering Brexit “as one United Kingdom” and would mean entering “a twilight world where the EU is given unprecedented powers over the UK”.
Ex-Foreign Secretary Boris Johnson dismissed the deal as a “paint and plaster pseudo-Brexit” and said its supporters would be “turning their backs” on the 17.4 million Leave voters.
The leader of the SNP at Westminster, Ian Blackford, said the “cold, hard truth” was that the deal represented “a moment of self-harm in our history”.
“It is not too late to turn back,” he said. “Fundamentally, there is no option that is going to be better for our economy, jobs, and for our communities than staying in the European Union.”
However, in closing the debate shortly after 01:00 GMT on Wednesday, Brexit Secretary Stephen Barclay argued the deal would bring “real changes which will improve the livelihoods of people up and down the country”.