MPs have voted to take control of Commons business in an unprecedented move to try to find a majority for any Brexit option.
The government was defeated by 329 votes to 302 on the cross-party amendment, a majority of 27.
It means MPs will get a series of votes on Wednesday to find out what kind of Brexit they will support.
Prime Minister Theresa May has said there is no guarantee she will abide by their decision.
Labour Leader Jeremy Corbyn, who had backed the amendment tabled by Conservative Sir Oliver Letwin, said the government "must take the process seriously".
He added: "The government has failed and this House must, and I believe will, succeed."
He said MPs would want to find a consensus on the way forward, including a possible "confirmatory vote" on the PM's deal by the public - something Mrs May told MPs earlier she did not want because Remain would be on the ballot paper.
In the series of so-called indicative votes, MPs will be able to vote on a series of options - likely to include a "softer Brexit", a customs union with the EU and another referendum - designed to test the will of Parliament to see what, if anything, commands a majority.
'Unwelcome precedent' - Prime Minister Theresa May
Mrs May had earlier tried to head off a defeat by offering MPs a series of votes on Brexit alternatives, organised by the government.
She said allowing MPs to take over the Commons agenda would have set an "unwelcome precedent".
But supporters of Sir Oliver Letwin's amendment said they did not trust the government to give MPs a say on the full range of Brexit options.
Thirty Tory MPs voted against the government, including three ministers - Richard Harrington, Alistair Burt and Steve Brine - who have now resigned from their ministerial posts.
Mrs May said earlier that her EU withdrawal deal did not have enough support to get through the Commons "as things stand", but she still hoped to persuade enough MPs to back it so she could hold another vote on it this week.
The deal has already been rejected twice by a large margin - and the PM was forced to ask the EU for Brexit to be delayed.
She plans to pass a law this week cancelling 29 March's exit date, and pushing Brexit back to at least 12 April.