MPs have voted by the thinnest of margins for a process that would make it more difficult for a future prime minister to prorogue Parliament.
Tory MP Dominic Grieve wanted to amend the Northern Ireland Bill to stop a future PM forcing through a no-deal Brexit by suspending Parliament.
His amendment - to require ministers to regularly report on the situation in Northern Ireland - passed by one vote.
It could provide a tool for MPs to block a no-deal Brexit in October.
Shadow Brexit secretary Sir Keir Starmer said the approval of Mr Grieve's proposal was a "tight but important victory".
He tweeted that it "makes it much harder for incoming prime minister to suspend Parliament".
The UK had been due to leave the EU on 29 March, but this date was delayed after MPs repeatedly rejected Theresa May's deal. Currently, the date for exit is 31 October.
If that date is reached without a deal being agreed on the separation process, then the UK will leave without one.
MPs have consistently voted against this option, but the prime minister could try to get around that by closing Parliament - proroguing - in the run-up to Brexit day, denying them an opportunity to block it.
Mr Grieve had sought to get MPs' backing for a package of measures he hoped would require Parliament to sit through October in the run up to the UK's departure.
One amendment, stating that MPs should be recalled to debate reports on Northern Ireland if Parliament is closed, wasn't selected for debate by Speaker John Bercow - although it could be introduced in the Lords later.
That took some of the force out of Mr Grieve's efforts.
However, two other amendments designed to make prorogation harder were put to a vote.
The first - approved by 294 votes to 293 - requires the government to produce fortnightly reports from October until December on the progress towards restoring the power sharing arrangements in Northern Ireland.
The second - which would have required the government to schedule debates on those progress reports - was defeated by 293 votes to 289.
While the success of that one amendment probably won't block prorogation, it could make it more difficult - especially if the House of Lords subsequently revives Mr Grieve's more forceful attempt to stop Parliament being temporarily suspended.
During the debate on Tuesday, Mr Grieve said: "If the other place (House of Lords) in its wisdom decides to look at the totality of our amendments and decides that the amendment new clause 14 (on preventing prorogation) would add value and places it in, this House will have an opportunity before this Bill goes through in order to consider that and either reject it or accept it."
Mr Grieve said he did not think democracy would survive Parliament being prorogued to allow for a no-deal Brexit.
He added: "Heaven knows, if I've tried to do anything during this Brexit process it's to try to encourage a sound process and to prevent catastrophic cliff edge moments and to enable this House to make reasoned decisions."
During the debate, Northern Ireland minister John Penrose said the government disagreed with Mr Grieve's suggestion for regular fortnightly reporting, with a vote on each occasion, calling it "an excessive and unnecessary level of procedure".