Proposals to further delay the date of Brexit have moved closer to becoming law after they passed through the Commons by one vote.
MPs supported the European Union (Withdrawal) (No 5) Bill at third reading by 313 votes to 312.
The draft legislation tabled by Labour former minister Yvette Cooper requires Prime Minister Theresa May to table a motion seeking MPs' approval for an extension to the Article 50 process beyond April 12 to a date of her choosing.
It is part of a parliamentary bid to prevent a no-deal departure from the EU.
Tory Brexiteers strongly opposed the measures and, shortly before the final vote, they expressed their frustration at the Bill clearing all stages in the Commons in a matter of hours.
Peter Bone (Wellingborough) urged Speaker John Bercow to "make this farce stop" and prevent further votes.
But there were cheers in the chamber when the result was revealed at almost 11.30pm, after the legislation passed through all stages in the Commons in a single day.
Speaking after the result Ms Cooper said it has been a "very considered and thoughtful debate throughout", and that MPs had "voted again to make clear the real concerns that there would be about a chaotic and damaging no deal".
She said the Bill would "support the Prime Minister's commitment to make sure we don't end up with no deal on April 12".
Ms Cooper added: "I'm sure that we will be very keen to work with Government to make sure that this legislation progresses in a way that is sensible and works in the national interest."
But Tory MP Mark Francois (Rayleigh and Wickford) reacted to the Bill's passing with anger, calling it a "constitutional outrage".
The leading Brexiteer said it had been "rammed through in four hours", and then quoting from the bible, added: "The public won't be impressed by this. Forgive them father they know not what they do."
The Bill will now undergo further scrutiny in the Lords at a later date, potentially as early as Thursday.
A Government spokesman said in a statement: "We are disappointed that MPs have chosen to back this Bill.
"The Prime Minister has already set out a clear process through which we can leave the European Union with a deal and we have already committed to seeking a further extension.
"If passed, this Bill would place a severe constraint on the Government's ability to negotiate an extension and reflect this new date in UK statute books before April 12."