UK MPs today approved an amendment by 315 votes to 274 that makes it more difficult for the next prime minister to force through a no-deal Brexit by suspending Parliament.
The amendment blocks a suspension between October 9 and December 18 unless a Northern Ireland executive is formed.
Seventeen Conservative MPs rebelled against the party line.
The House of Lords got behind the measure on Wednesday evening.
The frontrunner in the Conservative leadership race, Boris Johnson, has not ruled out suspending Parliament if he becomes prime minister to ensure the UK leaves the EU by 31 October, even if lawmakers have not got behind a deal.
His rival, Jeremy Hunt, has ruled out suspending Parliament.
The House of Lords' amendment to the Northern Ireland (Executive Formation) Bill would effectively prevent Parliament from being shut down by requiring progress reports on restoring the devolved government in Northern Ireland to be debated regularly.
As it stands, if the October 31 Brexit deadline is reached and Parliament has not backed an agreement between the government and Brussels, the UK is set to exit the EU without a deal.
While MPs have consistently rejected a no-deal Brexit in votes, the prime minister could try to sidestep lawmakers by suspending Parliament ahead of the deadline, which would mean they were unable to block it.