The government has said a bill to stop a no-deal Brexit will complete its passage through the Lords on Friday.
The proposed legislation was passed by MPs on Wednesday, inflicting a defeat on Prime Minister Boris Johnson.
There were claims pro-Brexit peers could deliberately hold up the bill so it could not get royal assent before Parliament is prorogued next week.
But the Conservative chief whip in the Lords announced a breakthrough in the early hours after talks with Labour.
The peers sat until 01:30 BST, holding a series of amendment votes that appeared to support predictions a marathon filibuster session – designed to derail the bill – was under way.
But then Lord Ashton of Hyde announced that all stages of the bill would be completed in the Lords by 17:00 BST on Friday.
He added that the Commons chief whip had also given a commitment that MPs will consider any Lords amendments on Monday and that the government intends that the “bill will be ready” to be presented for royal assent.
Labour leader Jeremy Corbyn previously said his party required the bill to gain royal assent before it would consider backing Mr Johnson’s call for a general election.
Baroness Smith, Labour leader in the House of Lords, confirmed the opposition supported the move in the Lords overnight, and said she hoped there would be “no further frustrations” of the bill as it goes through all its stages on Friday.
“It has been quite a night. It has been a long debate – and I am grateful to the noble Lords who have stayed the course – it shows the importance of the work we do and the issue we are debating,” she said.
“I am grateful that we are now able to confirm that we will be able to complete all stages of the bill in a time-honoured way by 5pm Friday.”
What does the no-deal bill say?
The bill, presented by Labour MP Hilary Benn, says the prime minister will have until 19 October to either pass a deal in Parliament or get MPs to approve a no-deal Brexit.
Once this deadline has passed, he will have to request an extension to the UK’s departure date to 31 January 2020.
Unusually, the bill stipulates the wording of the letter Mr Johnson would have to write to the president of the European Council.
If the EU responds by proposing a different date, the PM will have two days to accept that proposal.
During that time, MPs – not the government – will have the opportunity to reject that date.
The bill also requires ministers to report to the House of Commons over the next few months. potentially providing more opportunities to take control of the timetable.
The bill to block a no-deal went to the Lords after it passed all its stages in the Commons in one day, backed by opposition MPs and 21 Tory rebels working to push it through ahead of Parliament being suspended next week.
The prime minister was also defeated on Wednesday over his plan to hold a snap general election on 15 October.
Labour and other opposition MPs would not back the move while the option of a no-deal Brexit on 31 October remained open to the PM.
He needed two-thirds of all MPs to vote in favour – under the rules set by the Fixed Terms Parliaments Act – but, after Labour whipped its members to abstain, there were only 298 in favour of the motion and 56 against. That left Mr Johnson 133 short of his target.
Speaking after the vote, the prime minister said Mr Corbyn was “the first leader of the opposition in the democratic history of our country to refuse the invitation to an election”.
He said he “urged [Mr Corbyn’s] colleagues to reflect on the unsustainability of this position overnight and in the course of the next few days”.
But earlier, the Labour leader likened Mr Johnson’s offer to “an apple to Snow White from the Wicked Queen… offering the poison of a no-deal”.
He added: “Let this bill [to block a no deal] pass and gain royal assent, then we will back an election so we do not crash out.”
The government claims that progress has been made in redrafting elements of the Withdrawal Agreement painstakingly negotiated over the past two years.
However, Michel Barnier, the chief European Brexit negotiator, is reported to have told European diplomats that negotiations with London over the terms of Britain’s withdrawal from the EU are in a state of paralysis.
He also advised that Britain appeared intent on reducing the level of ambition in the political declaration that will steer the next stage of the negotiations.