MPs have voted by a majority of one to force the prime minister to ask for an extension to the Brexit process, in a bid to avoid any no-deal scenario, the BBC reports.
Labour's Yvette Cooper led the move, which the Commons passed in one day.
The bill will need Lords approval to become law, while it is the EU who decides whether to grant an extension.
It comes as talks between Prime Minister Theresa May and Labour leader Jeremy Corbyn to end the Brexit deadlock are set to continue.
Discussions between the two leaders on Wednesday were described as "constructive", but were criticised by MPs in both parties.
Meanwhile, Chancellor Philip Hammond has suggested that he expects Brussels to insist on a lengthy delay to Brexit and described a public vote to approve any final deal as "a perfectly credible proposition".